{
  "name": "optjs",
  "description": "Probably the sole command line option parser you'll ever need to...",
  "version": "3.2.1-boom",
  "author": {
    "name": "Daniel Wirtz",
    "email": "dcode@dcode.io"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/dcodeIO/opt.js.git"
  },
  "main": "./opt.js",
  "license": "NASA-1.3",
  "readme": "![opt.js](https://raw.github.com/dcodeIO/opt.js/master/opt.png)\r\n======\r\nProbably the sole command line option parser you'll ever need to <del>`npm install optjs`</del> Ctrl+C, Ctrl+V. Proof:\r\n\r\n```js\r\nfunction opt(argv) {\r\n    var opt={},arg,p;argv=Array.prototype.slice.call(argv||process.argv);for(var i=2;i<argv.length;i++)if(argv[i].charAt(0)=='-')\r\n    ((p=(arg=(\"\"+argv.splice(i--,1)).replace(/^[\\-]+/,'')).indexOf(\"=\"))>0?opt[arg.substring(0,p)]=arg.substring(p+1):opt[arg]=true);\r\n    return {'node':argv[0],'script':argv[1],'argv':argv.slice(2),'opt':opt};\r\n}\r\n```\r\n\r\nUsage\r\n-----\r\n```js\r\nvar opt = require(\"optjs\")();\r\nconsole.log(opt.node);   // Path to node executable\r\nconsole.log(opt.script); // Path to the current script\r\nconsole.log(opt.opt);    // Command line options as a hash\r\nconsole.log(opt.argv);   // Remaining non-option arguments\r\n```\r\n\r\nExample\r\n-------\r\n`node somescript.js foo -a=1 -b --c=\"hello world\" bar ----d`\r\n\r\n```js\r\n// Result\r\nopt.node   == \"/path/to/node[.exe]\"\r\nopt.script == \"/path/to/somescript.js\"\r\nopt.opt    == { a: 1, b: true, c: \"hello world\", d: true }\r\nopt.argv   == [\"foo\", \"bar\"]\r\n```\r\n\r\nFull-featured test suite\r\n------------------------\r\n```js\r\n#!/usr/bin/env node\r\nconsole.log(require(\"./opt.js\")());\r\n```\r\n\r\nLicense\r\n-------\r\nNASA Open Source Agreement v1.3\r\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/dcodeIO/opt.js/issues"
  },
  "_id": "optjs@3.2.1-boom",
  "dist": {
    "shasum": "68b84891b116e7293f21f30ab80ddfc6dfa135cf"
  },
  "_from": "optjs@latest",
  "_resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.1-boom.tgz"
}
