@cxy168/cmd-parser
v1.0.0
Published
Parsing operation instrution.
Downloads
8
Readme
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 }