Inquirer Checkbox Plus Prompt
A plugin for Inquirer, similar to the original checkbox with extra features.
Installation
npm install -g inquirer-checkbox-plus-prompt
Usage
You can name it with any name other than checkbox-plus
, just change the string 'checkbox-plus'
to anything else.
inquirer; inquirerprompt type: 'checkbox-plus' ...
Options
Takes type
, name
, message
, source
[, filter
, validate
, default
, pageSize
, highlight
, searchable
] properties.
The extra options that this plugin provides are:
- source: (Function) a method that called to return a promise that should be resolved with a list of choices in a similar format as the
choices
option in the originalcheckbox
prompt ofInquirer
. - highlight: (Boolean) if
true
, the current selected choice gets highlighted. Default:false
. - searchable: (Boolean) if
true
, allow the user to filter the list. Thesource
function gets called everytime the search query is changed. Default:false
.
Example
Check example.js for a more advanced example.
var inquirer = ;var fuzzy = ; inquirer; var colors = 'red' 'green' 'blue' 'yellow'; inquirerprompt type: 'checkbox-plus' name: 'colors' message: 'Enter colors' pageSize: 10 highlight: true searchable: true default: 'yellow' 'red' { input = input || ''; return { var fuzzyResult = fuzzy; var data = fuzzyResult; ; }; };
License
This project is under the MIT license.