0.1.5 • Published 2 years ago

@ainc/cli v0.1.5

Weekly downloads
1
License
MIT
Repository
-
Last release
2 years ago

@ainc/cli

The complete solution for node.js command-line interfaces,

Install

$ yarn add @ainc/cli

Usage

Create commands program, as cli.js:

import { commander } from '@ainc/cli';

// create server program with 'init' and 'start' command
commander({
    name: 'server',
    usage: '[command] [options]',
    version: '0.0.1',
    description: 'web server',
    commands: {
        init: {
            description: 'init server',
        },
        start: {
            usage: '[options]',
            description: 'start server',
            isDefault: true,
        },
    },
});

Create command, as start.js:

import { command } from '@ainc/cli';

// create start server command
command({
    config: 'server.config',
    options: {
        root: {
            type: 'dir',
            alias: 'r',
            description: 'the base directory of server',
        },
        port: {
            type: 'number',
            alias: 'p',
            description: 'the port of server',
        },
        open: {
            type: 'boolean',
            description: 'open the default browser',
        },
    }
});
0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.109

4 years ago

0.0.110

4 years ago

0.0.108

4 years ago

0.0.107

4 years ago

0.0.106

4 years ago

0.0.105

4 years ago

0.0.104

4 years ago

0.0.103

4 years ago

0.0.102

4 years ago

0.0.101

4 years ago