command-prompt
v0.0.6
Published
command-prompt
Downloads
7
Maintainers
Readme
command-prompt
Install
npm install --save command-prompt
yarn add command-prompt
Usage
import commandPrompt from 'command-prompt';
const options = {
name: 'choose your project',
choices: [
{
name: 'project1',
choices: [
{
name: 'clone project',
method() {
console.log('git clone.....');
}
},
{
name: 'fetch project',
method(again) {
console.log('git fetch.....');
again();
}
}
]
},
{
name: 'project2',
choices: [
{
name: 'clone project',
method() {
console.log('git clone.....');
}
},
{
name: 'fetch project',
method() {
console.log('git fetch.....');
}
}
]
},
{
name: 'exit',
method: () => process.exit()
}
]
}
commandPrompt(options);