
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-radio
Advanced tools
Radio prompt. This prompt behaves like other radio-button interfaces, where only one choice is enabled whilst all others are disabled. Can be used as a standalone prompt, or with a prompt system like [Enquirer].
Radio prompt. This prompt behaves like other radio-button interfaces, where only one choice is enabled whilst all others are disabled. Can be used as a standalone prompt, or with a prompt system like Enquirer.
Install with npm:
$ npm install --save prompt-radio
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('radio', require('prompt-radio'));
Enquirer supports both the declarative inquirer-style question format and a functional format using the .question
method:
.question
Functional style questions.
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('radio', require('prompt-radio'));
enquirer.question('color', 'What is your favorite color?', {
type: 'radio',
default: 'blue',
choices: ['red', 'yellow', 'blue']
});
enquirer.ask('color')
.then(function(answers) {
console.log(answers)
});
Inquirer-style questions
Declarative questions format.
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('radio', require('prompt-radio'));
var questions = [
{
name: 'color',
message: 'What is your favorite color?',
type: 'radio',
default: 'blue',
choices: ['red', 'yellow', 'blue']
}
];
enquirer.ask(questions)
.then(function(answers) {
console.log(answers)
});
Partially based on the checkbox
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 September 21, 2016.
FAQs
Radio prompt. Can be used as a standalone prompt, or as a plugin for [Enquirer].
We found that prompt-radio 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.
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.