inquirer-table-multiple
v1.0.0
Published
A table-like prompt for Inquirer
Downloads
10
Readme
inquirer-table-multiple
A table-like prompt for Inquirer.js
Installation
npm install --save inquirer-table-multiple
Usage
After registering the prompt, set any question to have type: "table"
to make use of this prompt.
The result will be an array, containing the value for each row.
inquirer.registerPrompt("table", require("./index"));
inquirer
.prompt([
{
type: "table",
name: "workoutPlan",
message: "Choose your workout plan for next week",
columns: [
{
name: "Arms",
value: "arms"
},
{
name: "Legs",
value: "legs"
},
{
name: "Cardio",
value: "cardio"
},
{
name: "None",
value: undefined
}
],
rows: [
{
name: "Monday",
value: []
},
{
name: "Tuesday",
value: []
},
{
name: "Wednesday",
value: []
},
{
name: "Thursday",
value: []
},
{
name: "Friday",
value: []
},
{
name: "Saturday",
value: []
},
{
name: "Sunday",
value: []
}
]
}
])
.then(answers => {
// do something
});
Options
columns
: Array of options to display as columns. Follows the same format as Inquirer'schoices
rows
: Array of options to display as rows. Follows the same format as Inquirer'schoices
pageSize
: Number of rows to display per page