查询者可选择的表格 
可选择的类似表格的提示 问讯员.js


安装
npm install --save @biggerstar/inquirer-selectable-table
使用量
在登记提示后,设置任何问题 type: "table" 利用这个提示.
结果将是一个阵列,包含每行的值.
inquirer.registerPrompt("table", require("inquirer-selectable-table"));
inquirer
.prompt([
{
type: "table",
name: "people",
message: "Choose your person of the week",
columns: [
{
name: "firstName",
value: "firstName",
},
{
name: "lastName",
value: "lastName",
},
{
name: "location",
value: "location",
},
],
rows: [
{
firstName: "Abel",
lastName: "Nazeh",
location: "Nigeria",
},
{
firstName: "Daniel",
lastName: "Ruiz",
location: "Spain",
},
{
firstName: "John",
lastName: "Doe",
location: "Leaf Village",
},
{
firstName: "Kakashi",
lastName: "Hatake",
location: "Leaf Village",
},
],
},
])
.then((answers) => {
console.log(answers);
});
选项
columns: 以列显示的选项组。 遵循与询问器相同的格式choicesrows: 以行显示的选项组。 遵循与询问器相同的格式choicespageSize: 每页显示行数