
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
prompt-grid
Advanced tools
Prompt that allows the user to re-arrange the cells in a grid in the terminal.
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 with npm:
$ npm install --save prompt-grid
Pass an array of choices to create a grid:
var Prompt = require('./');
var prompt = new Prompt({
name: 'letters',
message: 'Re-order cells',
choices: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']
});
// run as async
prompt.ask(function(answer) {
console.log(answer);
});
// run as promise
prompt.run()
.then(function(answer) {
console.log(answer);
});
Register the prompt as a plugin with enquirer:
var Enquirer = require('enquirer');
var enquirer = new Enquirer();
enquirer.register('readme', require('prompt-grid'));
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.ask(questions)
.then(function(answers) {
console.log(answers)
});
Expressive
Pre-define questions and easily compose prompts by passing the name(s) of the prompts to run:
enquirer.question('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
.prompt(['letters'])
.then(function(answers) {
console.log(answers)
});
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
Brian Woodward
Copyright © 2017, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on May 26, 2017.
FAQs
Prompt that allows the user to re-arrange the cells in a grid in the terminal.
We found that prompt-grid 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.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.