Simple arguments parser in 100 bytes
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
arg.js
package.json

README

Simple arguments parser in 100 bytes

By Mikhail Davydov, http://bit.ly/JXLHCO

* Installation
npm install arg

* Use it
var parse = require("arg").parse;

var options = parse("node server.js -h 0.0.0.0 -p 80 -s -a --vvvv --r-x /v 123 /x --debug-enabled=yes");

You got:

{
  "h": "0.0.0.0",
  "p": "80",
  "s": true,
  "a": true,
  "vvvv": true,
  "r-x": true,
  "v": 123,
  "x": true,
  "debug-enabled": "yes"
}