{"name":"yargs-parser","version":"18.1.1-beta.0","description":"the mighty option parser used by yargs","main":"index.js","scripts":{"fix":"standard --fix","test":"c8 --reporter=text --reporter=html  mocha test/*.js","posttest":"standard","coverage":"c8 report --check-coverage check-coverage --lines=100 --branches=97 --statements=100"},"repository":{"type":"git","url":"git+https://github.com/yargs/yargs-parser.git"},"keywords":["argument","parser","yargs","command","cli","parsing","option","args","argument"],"author":{"name":"Ben Coe","email":"ben@npmjs.com"},"license":"ISC","devDependencies":{"c8":"^7.0.1","chai":"^4.2.0","mocha":"^7.0.0","standard":"^14.3.1"},"dependencies":{"camelcase":"^5.0.0","decamelize":"^1.2.0"},"engines":{"node":">=6"},"readme":"# yargs-parser\n\n[![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser)\n[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser)\n[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)\n\n\nThe mighty option parser used by [yargs](https://github.com/yargs/yargs).\n\nvisit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.\n\n<img width=\"250\" src=\"https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png\">\n\n## Example\n\n```sh\nnpm i yargs-parser --save\n```\n\n```js\nvar argv = require('yargs-parser')(process.argv.slice(2))\nconsole.log(argv)\n```\n\n```sh\nnode example.js --foo=33 --bar hello\n{ _: [], foo: 33, bar: 'hello' }\n```\n\n_or parse a string!_\n\n```js\nvar argv = require('yargs-parser')('--foo=99 --bar=33')\nconsole.log(argv)\n```\n\n```sh\n{ _: [], foo: 99, bar: 33 }\n```\n\nConvert an array of mixed types before passing to `yargs-parser`:\n\n```js\nvar parse = require('yargs-parser')\nparse(['-f', 11, '--zoom', 55].join(' '))   // <-- array to string\nparse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings\n```\n\n## API\n\n### require('yargs-parser')(args, opts={})\n\nParses command line arguments returning a simple mapping of keys and values.\n\n**expects:**\n\n* `args`: a string or array of strings representing the options to parse.\n* `opts`: provide a set of hints indicating how `args` should be parsed:\n  * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`.\n  * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br>\n    Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br>\n    `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`.\n  * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`.\n  * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided\n    (or throws an error). For arrays the function is called only once for the entire array:<br>\n    `{coerce: {foo: function (arg) {return modifiedArg}}}`.\n  * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed).\n  * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br>\n    `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`.\n  * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).\n  * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`.\n  * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`.\n  * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed.\n  * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`.\n  * `opts.normalize`: `path.normalize()` will be applied to values set to this key.\n  * `opts.number`: keys should be treated as numbers.\n  * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).\n\n**returns:**\n\n* `obj`: an object representing the parsed value of `args`\n  * `key/value`: key value pairs for each argument and their aliases.\n  * `_`: an array representing the positional arguments.\n  * [optional] `--`:  an array with arguments after the end-of-options flag `--`.\n\n### require('yargs-parser').detailed(args, opts={})\n\nParses a command line string, returning detailed information required by the\nyargs engine.\n\n**expects:**\n\n* `args`: a string or array of strings representing options to parse.\n* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`.\n\n**returns:**\n\n* `argv`: an object representing the parsed value of `args`\n  * `key/value`: key value pairs for each argument and their aliases.\n  * `_`: an array representing the positional arguments.\n  * [optional] `--`:  an array with arguments after the end-of-options flag `--`.\n* `error`: populated with an error object if an exception occurred during parsing.\n* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`.\n* `newAliases`: any new aliases added via camel-case expansion:\n  * `boolean`: `{ fooBar: true }`\n* `defaulted`: any new argument created by `opts.default`, no aliases included.\n  * `boolean`: `{ foo: true }`\n* `configuration`: given by default settings and `opts.configuration`.\n\n<a name=\"configuration\"></a>\n\n### Configuration\n\nThe yargs-parser applies several automated transformations on the keys provided\nin `args`. These features can be turned on and off using the `configuration` field\nof `opts`.\n\n```js\nvar parsed = parser(['--no-dice'], {\n  configuration: {\n    'boolean-negation': false\n  }\n})\n```\n\n### short option groups\n\n* default: `true`.\n* key: `short-option-groups`.\n\nShould a group of short-options be treated as boolean flags?\n\n```sh\nnode example.js -abc\n{ _: [], a: true, b: true, c: true }\n```\n\n_if disabled:_\n\n```sh\nnode example.js -abc\n{ _: [], abc: true }\n```\n\n### camel-case expansion\n\n* default: `true`.\n* key: `camel-case-expansion`.\n\nShould hyphenated arguments be expanded into camel-case aliases?\n\n```sh\nnode example.js --foo-bar\n{ _: [], 'foo-bar': true, fooBar: true }\n```\n\n_if disabled:_\n\n```sh\nnode example.js --foo-bar\n{ _: [], 'foo-bar': true }\n```\n\n### dot-notation\n\n* default: `true`\n* key: `dot-notation`\n\nShould keys that contain `.` be treated as objects?\n\n```sh\nnode example.js --foo.bar\n{ _: [], foo: { bar: true } }\n```\n\n_if disabled:_\n\n```sh\nnode example.js --foo.bar\n{ _: [], \"foo.bar\": true }\n```\n\n### parse numbers\n\n* default: `true`\n* key: `parse-numbers`\n\nShould keys that look like numbers be treated as such?\n\n```sh\nnode example.js --foo=99.3\n{ _: [], foo: 99.3 }\n```\n\n_if disabled:_\n\n```sh\nnode example.js --foo=99.3\n{ _: [], foo: \"99.3\" }\n```\n\n### boolean negation\n\n* default: `true`\n* key: `boolean-negation`\n\nShould variables prefixed with `--no` be treated as negations?\n\n```sh\nnode example.js --no-foo\n{ _: [], foo: false }\n```\n\n_if disabled:_\n\n```sh\nnode example.js --no-foo\n{ _: [], \"no-foo\": true }\n```\n\n### combine arrays\n\n* default: `false`\n* key: `combine-arrays`\n\nShould arrays be combined when provided by both command line arguments and\na configuration file.\n\n### duplicate arguments array\n\n* default: `true`\n* key: `duplicate-arguments-array`\n\nShould arguments be coerced into an array when duplicated:\n\n```sh\nnode example.js -x 1 -x 2\n{ _: [], x: [1, 2] }\n```\n\n_if disabled:_\n\n```sh\nnode example.js -x 1 -x 2\n{ _: [], x: 2 }\n```\n\n### flatten duplicate arrays\n\n* default: `true`\n* key: `flatten-duplicate-arrays`\n\nShould array arguments be coerced into a single array when duplicated:\n\n```sh\nnode example.js -x 1 2 -x 3 4\n{ _: [], x: [1, 2, 3, 4] }\n```\n\n_if disabled:_\n\n```sh\nnode example.js -x 1 2 -x 3 4\n{ _: [], x: [[1, 2], [3, 4]] }\n```\n\n### greedy arrays\n\n* default: `true`\n* key: `greedy-arrays`\n\nShould arrays consume more than one positional argument following their flag.\n\n```sh\nnode example --arr 1 2\n{ _[], arr: [1, 2] }\n```\n\n_if disabled:_\n\n```sh\nnode example --arr 1 2\n{ _[2], arr: [1] }\n```\n\n**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.**\n\n### nargs eats options\n\n* default: `false`\n* key: `nargs-eats-options`\n\nShould nargs consume dash options as well as positional arguments.\n\n### negation prefix\n\n* default: `no-`\n* key: `negation-prefix`\n\nThe prefix to use for negated boolean variables.\n\n```sh\nnode example.js --no-foo\n{ _: [], foo: false }\n```\n\n_if set to `quux`:_\n\n```sh\nnode example.js --quuxfoo\n{ _: [], foo: false }\n```\n\n### populate --\n\n* default: `false`.\n* key: `populate--`\n\nShould unparsed flags be stored in `--` or `_`.\n\n_If disabled:_\n\n```sh\nnode example.js a -b -- x y\n{ _: [ 'a', 'x', 'y' ], b: true }\n```\n\n_If enabled:_\n\n```sh\nnode example.js a -b -- x y\n{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }\n```\n\n### set placeholder key\n\n* default: `false`.\n* key: `set-placeholder-key`.\n\nShould a placeholder be added for keys not set via the corresponding CLI argument?\n\n_If disabled:_\n\n```sh\nnode example.js -a 1 -c 2\n{ _: [], a: 1, c: 2 }\n```\n\n_If enabled:_\n\n```sh\nnode example.js -a 1 -c 2\n{ _: [], a: 1, b: undefined, c: 2 }\n```\n\n### halt at non-option\n\n* default: `false`.\n* key: `halt-at-non-option`.\n\nShould parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line.\n\n_If disabled:_\n\n```sh\nnode example.js -a run b -x y\n{ _: [ 'b' ], a: 'run', x: 'y' }\n```\n\n_If enabled:_\n\n```sh\nnode example.js -a run b -x y\n{ _: [ 'b', '-x', 'y' ], a: 'run' }\n```\n\n### strip aliased\n\n* default: `false`\n* key: `strip-aliased`\n\nShould aliases be removed before returning results?\n\n_If disabled:_\n\n```sh\nnode example.js --test-field 1\n{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 }\n```\n\n_If enabled:_\n\n```sh\nnode example.js --test-field 1\n{ _: [], 'test-field': 1, testField: 1 }\n```\n\n### strip dashed\n\n* default: `false`\n* key: `strip-dashed`\n\nShould dashed keys be removed before returning results?  This option has no effect if\n`camel-case-expansion` is disabled.\n\n_If disabled:_\n\n```sh\nnode example.js --test-field 1\n{ _: [], 'test-field': 1, testField: 1 }\n```\n\n_If enabled:_\n\n```sh\nnode example.js --test-field 1\n{ _: [], testField: 1 }\n```\n\n### unknown options as args\n\n* default: `false`\n* key: `unknown-options-as-args`\n\nShould unknown options be treated like regular arguments?  An unknown option is one that is not\nconfigured in `opts`.\n\n_If disabled_\n\n```sh\nnode example.js --unknown-option --known-option 2 --string-option --unknown-option2\n{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true }\n```\n\n_If enabled_\n\n```sh\nnode example.js --unknown-option --known-option 2 --string-option --unknown-option2\n{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' }\n```\n\n## Special Thanks\n\nThe yargs project evolves from optimist and minimist. It owes its\nexistence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \\o/\n\n## License\n\nISC\n","readmeFilename":"README.md","gitHead":"366a9ae6a1ca4ebe0a90a55028e35d45247a8240","bugs":{"url":"https://github.com/yargs/yargs-parser/issues"},"homepage":"https://github.com/yargs/yargs-parser#readme","_id":"yargs-parser@18.1.1-beta.0","_nodeVersion":"13.10.1","_npmVersion":"6.13.7","dist":{"integrity":"sha512-Kug96Ox8+Dz+q4wylPkw/Ry7ACvU9Dc4Pa2NR3GNNWGMji7HEOq9V4l2tWSXOL9wHgD5iYpu81yS+y/B2t/IOA==","shasum":"fd67039f77ffbd4bb1c928272d7138cd9282c52f","tarball":"http://registry-npm.ywwl.com/yargs-parser/download/yargs-parser-18.1.1-beta.0.tgz","fileCount":6,"unpackedSize":69667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJean1cCRA9TVsSAnZWagAAV3IP/A7mKRtUndmybKWK1KlO\nN34DWGSQg69MZpI1K7OETZExFzOtl0/o4NMavsWiB5EHt9y07yoWZtJgUz7L\n3yTjlrmNghpTiEOtwgpn02aFLv9nnp9C60GGDYpPfKttT/+E7+gDuNGDpBIJ\nPt0J9o1ZTDHom599tl/fqbOxul8COYtW5dDLNQSmqkS1+ekPzFnE2PolUIDI\n9Ufz3/v15WXYvcLrYQ3flHZCdh0QY6keTmT0cwYv297EhSAGNBgUEOyQZ+ui\nuWUew3Yoi88IOyrbwi6+IPI19xp4lYFYUYt27hNNJ5u7c944J9yoGWR6am0Q\nIuovhb92sikpgFwdAcLOQrVGDWBrlwBWZD6nbT5Ns7U5gENvaDV1M5FBtv4J\nfT4hR7P22MvcjCBWkM/V5UqYKxbCRGNhfWtorXZkcJYHPDoJ1uNK0BBc7Udr\nmjX7pPNB+UEwMMEfvdnahQqVbxQczDNDS/bCE6B8ZOFXAtyaxewHTFH27x+F\nVIhfhvCM8rhfDNBNLHDCr7suWOzr8nJy10sxhCM/nvxG27ZfXroruSm0IPyA\n5rWf4txywp1Hi6t5Wg72c5ElFJSrpBNxf2bRTMBfeJKnf76rfFo4NsrUGyyn\nDPV0GlT2zR2muH4KhRUehgTPFYUdcbtHGyeKQ49Bj0TcvCh/JrYMss82YS3a\nbOae\r\n=yF9Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+0ap7Cq3eTcBfZ9yGJbjJanb1IaGpnqZMcJ0C24q/0AiBB9Jtd/7vXfoW/RwqqjNb1NGQBpVKbsTYp9RkdyJYk8g=="}],"size":18539,"noattachment":false,"key":"/yargs-parser/-/yargs-parser-18.1.1-beta.0.tgz"},"maintainers":[{"email":"bencoe@gmail.com","name":"bcoe"},{"email":"andrewbgoode@gmail.com","name":"nexdrew"},{"email":"bencoe+oss-bot@gmail.com","name":"oss-bot"}],"_npmUser":{"name":"oss-bot","email":"bencoe+oss-bot@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yargs-parser_18.1.1-beta.0_1584037211673_0.6470280159620365"},"_hasShrinkwrap":false,"publish_time":1584037211828,"_cnpm_publish_time":1584037211828,"dist-tags":{"alpha":"1.1.1-alpha3","latest":"22.0.0","latest-13":"13.1.2","latest-15":"15.0.3","latest-5":"5.0.1","next":"20.2.6"}}