
Product
Introducing Supply Chain Attack Campaigns Tracking in the Socket Dashboard
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.
composer-confirm
Advanced tools
Uses [prompt-confirm] to conditionally run composer tasks based on responses to prompts. Can also be used with assemble, generate, verb and update (instead of composer).
Uses prompt-confirm to conditionally run composer tasks based on responses to prompts. Can also be used with assemble, generate, verb and update (instead of composer).
Install with npm:
$ npm install --save composer-confirm
var Composer = require('composer');
var composer = new Composer();
// pass an instance of composer and optional fn
// if `fn` is passed it will be called with the prompt
// instance before running the prompt
var confirm = require('composer-confirm')(composer, fn);
confirm(taskName, message, yesCallback, noCallback);
Callbacks for yes and no can be any valid argument to a composer task.
Functions
confirm('default', 'Want to run this?', function(cb) {
console.log('YES!!! :)');
cb();
}, function(cb) {
console.log('NO?!! :(');
cb();
});
No-op
Simulate a no-op task by passing an empty array.
confirm('default', 'Want to run this?', [], function(cb) {
console.log('NO?!! :(');
cb();
});
Task names
app.task('yes', function(cb) {
console.log('YES!!! :)');
cb();
})
app.task('no', function(cb) {
console.log('NO?!! :(');
cb();
})
confirm('default', 'Want to run this?', 'yes', 'no');
Arrays of task names
app.task('yes', function(cb) {
console.log('YES!!! :)');
cb();
});
app.task('and', function(cb) {
cb();
})
app.task('no', function(cb) {
console.log('NO?!! :(');
cb();
});
app.task('but', function(cb) {
cb();
});
confirm('default', 'Want to run this?', ['yes', 'and'], ['no', 'but']);
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on June 02, 2017.
FAQs
Uses [prompt-confirm] to conditionally run composer tasks based on responses to prompts. Can also be used with assemble, generate, verb and update (instead of composer).
We found that composer-confirm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.