1.0.0 • Published 7 years ago

@cxy168/cmd-parser v1.0.0

Weekly downloads
1
License
-
Repository
-
Last release
7 years ago

cmdParser

Sometimes, we need to run our js script according to the user's instructions entered in the terminal. CmdParser is such a nodejs module for parsing user instructions.

Install

npm install @cxy/cmd-parser

API

cmdParser(callback:? (argvMap:ArgvMap) => void) => Promise<ArgvMap>

Usage

const cmdParser = require('@cxy168/cmd-parser');

cmdParser().then(argv => console.info(arvs));
> node . --name hello -v 1.0.0 --private

{ name: 'hello', v: '1.0.0', private: true }