Smart command line parser and handler for node js.
The smart Node JS command line parser module provides an easy API that makes an abstraction of a command line. It allows you to specify the order and type of the expected (required) arguments, and the names and types of the optional (named) arguments.
It uses a json-style notation for command lines, for example:
node example.js -debug -encoding:ascii -value:4.5 some ordered arguments -flag:false
All arguments are parsed, and the resulting object will have the following properties:
It is possible to map the ordered arguments to property names by specifying those names at object construction time.
The easiest way to install node-commandline is to use the NPM package manager:
npm install node-commandline
This project is derived from my previous work for the node js serial-to-tcp server.