0.0.6 • Published 5 years ago

command-prompt v0.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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);

图片1

图片1

图片1