Parse command-line into your NodeJS applications.
npm install node-comline
Parses your command-line arguments and returns an object with them all in.
var com = require('node-comline');
// The module provides a single function to interact with, that simply returns
// all arguments parsed when the application was run
// By default, "-" and "--" are removed from the begining of
// the arguements provided; so "--that=argument" will return
// {"that":"argument"}
var config = {"removesingles":false, "removedoubles":false};
// Do this to turn that off
//The core function, set to "com()" in this case...
// Will directly return an object of arugment and value pairs
// So...
console.log(com());
// Will return an [object], without any configuration
// Whereas...
console.log(com(config));
// Will return an [object], and take into account the above created configuration
NodeOpt by Darren Looby is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at https://github.com/darrenlooby/node-comline.