
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
prompt-confirm
Advanced tools
Confirm (yes/no) prompt. Can be used standalone or with a prompt system like [Enquirer].
Confirm (yes/no) prompt. Can be used standalone or with a prompt system like Enquirer.
Install with npm:
$ npm install --save prompt-confirm
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('confirm', require('prompt-confirm'));
Enquirer supports both the declarative inquirer-style question format and a functional format using the .question
method:
Single question
Ask one question using the .prompt
method:
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('checkbox', require('prompt-confirm'));
enquirer.question('chocolate', 'Like chocolate?', {type: 'confirm'});
enquirer.question('vanilla', 'Like vanilla?', {type: 'confirm'});
enquirer.prompt('vanilla')
.then(function(answers) {
console.log(answers)
});
Functional
Functional style questions.
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('checkbox', require('prompt-confirm'));
enquirer.question('chocolate', 'Like chocolate?', {type: 'confirm'});
enquirer.question('vanilla', 'Like vanilla?', {type: 'confirm'});
enquirer.ask(['chocolate', 'vanilla'])
.then(function(answers) {
console.log(answers)
});
Declarative
Inquirer-style questions format.
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('checkbox', require('prompt-confirm'));
var questions = [
{type: 'confirm', name: 'chocolate', message: 'Like chocolate?'},
{type: 'confirm', name: 'vanilla', message: 'Like vanilla?'}
];
enquirer.ask(questions)
.then(function(answers) {
console.log(answers)
});
Based on the confirm
prompt in inquirer.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.1.31, on October 13, 2016.
FAQs
Confirm (yes/no) prompt. Can be used standalone or with a prompt system like [Enquirer].
The npm package prompt-confirm receives a total of 23,136 weekly downloads. As such, prompt-confirm popularity was classified as popular.
We found that prompt-confirm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.