package.json "scripts": { "start": "node script/index" },
/index.js
const inquirer = require('inquirer');
const cmd = require('node-cmd');
const server = require('./server');
const promptList = [
{
type: 'list',
message: '请选择一个要启动的文件:',
name: 'fruit',
choices: [
"CeShi1",
"CeShi2",
"CeShi3"
]
},
{
type: "checkbox",
message: "选择参数:",
name: "params",
choices: [
{
name: "name",
checked: true // 默认选中
},
{
name: "age"
},
{
name: "sex",
},
{
name: "phone"
}
]
},
];
server.server().then(res=>{
inquirer.prompt(promptList).then(answers => {
console.log(answers);
cmd.run(`nod