node-cloparser

0.0.1 • Public • Published

node-cloparser

Command Line Options Parser for Node.js

Usage

test.js:

var cloparser = require("node-cloparser");
var options = {
	a: false,
	b: true
};
var extras = cloparser(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/node-cloparser

Release note

  • 2016-09-04 version 0.0.1
    • First release.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i node-cloparser

      Weekly Downloads

      0

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • shimataro