Skip to content

ZYSzys/light-cmd

Repository files navigation

light-cmd

Build Status codecov NPM version NPM downloads js-standard-style license

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

About

(Unfinished) Light command line tool for Node.js.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published