{"name":"dargs","version":"6.0.0","description":"Reverse minimist. Convert an object of options into an array of command-line arguments.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/dargs.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["reverse","minimist","options","arguments","args","flags","cli","nopt","commander","bin","binary","command","cmd","inverse","opposite","invert","switch","construct","parse","parser","argv"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"926509985730c9d233b03fc8bf753f7b4208ff4b","bugs":{"url":"https://github.com/sindresorhus/dargs/issues"},"homepage":"https://github.com/sindresorhus/dargs#readme","_id":"dargs@6.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-6lJauzNaI7MiM8EHQWmGj+s3rP5/i1nYs8GAvKrLAx/9dpc9xS/4seFb1ioR39A+kcfu4v3jnEa/EE5qWYnitQ==","shasum":"da35d4633cd821de868f97d645f8d1f9b0353a24","tarball":"http://registry-npm.ywwl.com/dargs/download/dargs-6.0.0.tgz","fileCount":4,"unpackedSize":6974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCTSOCRA9TVsSAnZWagAAf3QQAJtvHrZte1/qJ8wnN5t5\n31a6RcoKJx2AAIG+kxJZ7hj0zSm0tEJwt+vnFe+qwxw7RUOQjGPJwgqJQV9R\ncWodc3FI+Bx3iQjLnchxhLlUiWGR3nbayaZrW8SdGP5qM1LORVCaR9dTahXA\nwbYWH1+DO9L1kmEvRv7c2c5RM3V06+MiCSXBqfp9MeqvwIflwX4j2wkX76UV\nrVRMIDw4KssZgS2nQVqLpCEeexTyyHvov/das8yMx4LgBflVzfYf7VSZn1L3\nMOwbOkH9HHK4hNDl9FB4hSBXTiwmn+iIuMPOCEpcPnLzFpljD8I788dnhT6I\ncdSg8jXLezMd15efBLJAtGqym0Kb9+JKN4Qwz8r7H9leJ1zmUabn5+Jy4X+I\n6PTo5UZDjS4Pg6o8SLu0efnaBrPBcYRWhplbvqPcPnpNgi8kZLiitmC4jke8\nUp2pKgM+E+mg6RR/NfDLuoagZ/FV/+gfLxHlNFZmYC0oiJIPZqT0yXyHr7Vb\nCCkCYQYgLivRz6hp6LEAgsL1vEq0bRfk4jK9H4vqT9ee7+qBYwvQDELjTxor\nOgo3lBBFgU+y8kG3ZpSXs62tRqsB4+I7VsmoHAObEPgfkps5tt/nFEVyO7jq\nsGiYqCAfX0fZhSt3GKQtBg8paOTRDPGfB8GjMiNdi4ejc7chRu7FzXWoyzC/\no3zn\r\n=/JF1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX4P8vroq1nQVF1rmaxbrnDq296j5TOf12EzaZ1H8YowIhALNG1xIrAoat2Z0GHmXAahgbWbMoUyOcnxxhFah7r2ic"}],"size":3074,"noattachment":false,"key":"/dargs/-/dargs-6.0.0.tgz"},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dargs_6.0.0_1527329933419_0.13146743229601499"},"_hasShrinkwrap":false,"readme":"# dargs\n\n> Reverse [`minimist`](https://github.com/substack/minimist). Convert an object of options into an array of command-line arguments.\n\nUseful when spawning command-line tools.\n\n## Install\n\n```\n$ npm install dargs\n```\n\n## Usage\n\n```js\nimport dargs from 'dargs';\n\nconst object = {\n\t_: ['some', 'option'],          // Values in '_' will be appended to the end of the generated argument list\n\t'--': ['separated', 'option'],  // Values in '--' will be put at the very end of the argument list after the escape option (`--`)\n\tfoo: 'bar',\n\thello: true,                    // Results in only the key being used\n\tcake: false,                    // Prepends `no-` before the key\n\tcamelCase: 5,                   // CamelCase is slugged to `camel-case`\n\tmultiple: ['value', 'value2'],  // Converted to multiple arguments\n\tpieKind: 'cherry',\n\tsad: ':('\n};\n\nconst excludes = ['sad', /.*Kind$/];  // Excludes and includes accept regular expressions\nconst includes = ['camelCase', 'multiple', 'sad', /^pie.*/];\nconst aliases = {file: 'f'};\n\nconsole.log(dargs(object, {excludes}));\n/*\n[\n\t'--foo=bar',\n\t'--hello',\n\t'--no-cake',\n\t'--camel-case=5',\n\t'--multiple=value',\n\t'--multiple=value2',\n\t'some',\n\t'option',\n\t'--',\n\t'separated',\n\t'option'\n]\n*/\n\nconsole.log(dargs(object, {excludes, includes}));\n/*\n[\n\t'--camel-case=5',\n\t'--multiple=value',\n\t'--multiple=value2'\n]\n*/\n\n\nconsole.log(dargs(object, {includes}));\n/*\n[\n\t'--camel-case=5',\n\t'--multiple=value',\n\t'--multiple=value2',\n\t'--pie-kind=cherry',\n\t'--sad=:('\n]\n*/\n\n\nconsole.log(dargs({\n\tfoo: 'bar',\n\thello: true,\n\tfile: 'baz'\n}, {aliases}));\n/*\n[\n\t'--foo=bar',\n\t'--hello',\n\t'-f', 'baz'\n]\n*/\n```\n\n## API\n\n### dargs(object, options?)\n\n#### object\n\nType: `object`\n\nObject to convert to command-line arguments.\n\n#### options\n\nType: `object`\n\n##### excludes\n\nType: `Array<string | RegExp>`\n\nKeys or regex of keys to exclude. Takes precedence over `includes`.\n\n##### includes\n\nType: `Array<string | RegExp>`\n\nKeys or regex of keys to include.\n\n##### aliases\n\nType: `object`\n\nMaps keys in `object` to an aliased name. Matching keys are converted to arguments with a single dash (`-`) in front of the aliased key and the value in a separate array item. Keys are still affected by `includes` and `excludes`.\n\n##### useEquals\n\nType: `boolean`\\\nDefault: `true`\n\nSetting this to `false` makes it return the key and value as separate array items instead of using a `=` separator in one item. This can be useful for tools that doesn't support `--foo=bar` style flags.\n\n```js\nimport dargs from 'dargs';\n\nconsole.log(dargs({foo: 'bar'}, {useEquals: false}));\n/*\n[\n\t'--foo', 'bar'\n]\n*/\n```\n\n##### shortFlag\n\nType: `boolean`\\\nDefault: `true`\n\nMake a single character option key `{a: true}` become a short flag `-a` instead of `--a`.\n\n```js\nimport dargs from 'dargs';\n\nconsole.log(dargs({a: true}));\n//=> ['-a']\n\nconsole.log(dargs({a: true}, {shortFlag: false}));\n//=> ['--a']\n```\n\n##### ignoreTrue\n\nType: `boolean`\\\nDefault: `false`\n\nExclude `true` values. Can be useful when dealing with argument parsers that only expect negated arguments like `--no-foo`.\n\n##### ignoreFalse\n\nType: `boolean`\\\nDefault: `false`\n\nExclude `false` values. Can be useful when dealing with strict argument parsers that throw on unknown arguments like `--no-foo`.\n\n##### allowCamelCase\n\nType: `boolean`\\\nDefault: `false`\n\nBy default, camel-cased keys will be hyphenated. Enabling this will bypass the conversion process.\n\n```js\nimport dargs from 'dargs';\n\nconsole.log(dargs({fooBar: 'baz'}));\n//=> ['--foo-bar', 'baz']\n\nconsole.log(dargs({fooBar: 'baz'}, {allowCamelCase: true}));\n//=> ['--fooBar', 'baz']\n```\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-dargs?utm_source=npm-dargs&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","publish_time":1527329933480,"_cnpm_publish_time":1527329933480,"dist-tags":{"latest":"8.1.0"}}