light-cmd
v0.0.3
Published
Light command line for Node.js.
Downloads
6
Readme
light-cmd
Light command line for Node.js.
Install
$ npm install light-cmd
Usage
const cmd = require('light-cmd')
cmd
.version('0.0.1')
.option('-a, --age', 'show the age', () => console.log('Age: 100'))
cmd
.parse(process.argv)
API
See examples for how to using.
cmd.version(input)
input
Type: string
The semver version.
cmd.option(flags, descrition, fn)
flags
Type: string
descrition
Type: string
fn
Type: function
cmd.command(flags)
flags
Type: string
cmd.action(fn)
fn
Type: function
cmd.parse(argv)
argv
Type: Array
Usually using process.argv
License
MIT © ZYSzys