Package Exports
- prompt-checkbox
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (prompt-checkbox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
prompt-checkbox

Adds multiple-choice/checkbox prompt support to Enquirer.

Install
Install with npm:
$ npm install --save prompt-checkboxUsage
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('checkbox', require('prompt-checkbox'));Example
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('checkbox', require('prompt-checkbox'));
enquirer.question('color', 'What is your favorite color?', {
type: 'checkbox',
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('checkbox', require('prompt-checkbox'));
var questions = [
{
name: 'color',
message: 'What is your favorite color?',
type: 'checkbox',
default: 'blue',
choices: ['red', 'yellow', 'blue']
}
];
enquirer.ask(questions)
.then(function(answers) {
console.log(answers)
});Attribution
Based on the checkbox prompt in inquirer.
About
Related projects
- enquirer-prompt: Base prompt module used for creating custom prompt types for Enquirer. | homepage
- enquirer-question: Question object, used by Enquirer and prompt plugins. | homepage
- enquirer: Plugin-based prompt system for node.js | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running tests
Install dev dependencies:
$ npm install -d && npm testAuthor
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.1.30, on August 30, 2016.