prompt-grid
Prompt that allows the user to re-arrange the cells in a grid in the terminal.
If you like this project please consider starring it.
Install
Install with npm:
$ npm install --save prompt-grid
Usage
Pass an array of choices to create a grid:
var Prompt = ;var prompt = name: 'letters' message: 'Re-order cells' choices: 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I'; // run as asyncprompt; // run as promiseprompt ;
Enquirer usage
Register the prompt as a plugin with enquirer:
var Enquirer = ;var enquirer = ; enquirer;
Enquirer example
Enquirer supports either the declarative object-oriented (inquirer-style) question format or a more expressive format using the .question
method.
Declarative
Inquirer-style declarative format (takes an array or object):
var questions = name: 'letters' type: 'grid' message: 'Hold shift+(up|right|down|left) to re-arrange cells' choices: 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' ; enquirer ;
Expressive
Pre-define questions and easily compose prompts by passing the name(s) of the prompts to run:
enquirer; enquirer prompt'letters' ;
About
Related projects
- prompt-base: Base prompt module used for creating custom prompts. | homepage
- prompt-checkbox: Multiple-choice/checkbox prompt. Can be used standalone or with a prompt system like Enquirer. | homepage
- prompt-password: Password prompt. Can be used as a standalone prompt, or with a prompt system like… more | homepage
- prompt-sort: Prompt that allows the user to re-order items in a list of choices. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running tests
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
Author
Brian Woodward
License
Copyright © 2017, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on May 26, 2017.