command-prompt
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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

/command-prompt/

    Package Sidebar

    Install

    npm i command-prompt

    Weekly Downloads

    1

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    24.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • m-ryan