clo-parser
v0.0.1
Published
Command Line Options Parser for Node.js
Downloads
3
Readme
clo-parser
Command Line Options Parser for Node.js
Usage
test.js:
var clo_parser = require("clo-parser");
var options = {
a: false,
b: true
};
var extras = clo_parser(options);
console.log(options);
console.log(extras);
output:
$ node test.js
{ a: false, b: true }
[]
$ node test.js -a
{ a: true, b: true }
[]
$ node test.js -option
{ a: false, b: true, o: true, p: true, t: true, i: true, n: true }
[]
$ node test.js -opt -ion
{ a: false, b: true, o: true, p: true, t: true, i: true, n: true }
[]
$ node test.js -opt ion
{ a: false, b: true, o: true, p: true, t: true }
[ 'ion' ]
$ node test.js opt ion
{ a: false, b: true }
[ 'opt', 'ion' ]
$ node test.js -opt=ion
{ a: false, b: true, o: true, p: true, t: 'ion' }
[]
Project page
http://github.com/shimataro/clo-parser
Release note
- 2016-09-04 version 0.0.1
- First release.