Prompt that allows the user to re-order items in a list of choices.
Use shift+up or shift+down to re-order list items.
(you can do this kind of customization with any prompt)
The colors used in the example were added just for that example. See how that works in examples/prompt.js.
var Prompt = ;var prompt =name: 'colors'message: 'Sort colors from most to least favorite'choices:'green''red''yellow';// promiseprompt;// or asyncprompt;
Register as a plugin with enquirer:
var Enquirer = ;var enquirer = ;enquirer;
Enquirer supports both the declarative inquirer-style question format and a functional format using the
Questions can be defined as an array of objects, or a single question object:
var questions =type: 'sort' // <= define the prompt "type"name: 'colors'message: 'Sort colors from most to least favorite'choices:'green''red''yellow';enquirer;
Functional style questions.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
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
This file was generated by verb-generate-readme, v0.6.0, on June 05, 2017.