{"name":"dargs","version":"8.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"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["reverse","minimist","options","arguments","args","flags","cli","nopt","commander","binary","command","inverse","opposite","invert","switch","construct","parse","parser","argv"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"b80546a5bb2ba0dcb773efdf56601889c9168f0d","bugs":{"url":"https://github.com/sindresorhus/dargs/issues"},"homepage":"https://github.com/sindresorhus/dargs#readme","_id":"dargs@8.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-uNt1339Xt7lA08sO/0umb/aB7DlLwzl+fV/2bLQIu8QiZ8n4z1CWMKd5UqWF1KMAakg24uIxqklAg+WfjJtcQQ==","shasum":"e754b058167f6eb7a973fa12c60bdd5d989f7cec","tarball":"http://registry-npm.ywwl.com/dargs/download/dargs-8.0.0.tgz","fileCount":5,"unpackedSize":11876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkA/LCRA9TVsSAnZWagAA8wcP/3MMuMvX6Et+UbpiUNoe\nHgjd+xn9wiQkwqp6d1dDDe3htj9ZecvIPr7Hjg0HzLuTM6SwNQ3jfdD5Y2ma\npAb/oJdIR2Yh5YHQ4L4j4Qr/dvOOYV5bvc37GVS3Wt9asl1OwTBSw8W36S2N\nQ117ft9oI2FP/Oe6T+4miYStz2KcO7TsmqIqh/NoSPQicf3WgNCyVnX7I6fr\nVBPZYCGZWHj2Drb2E98V6t/km/6MUxntLO7lsWjofg03KyJO4SVrjjJXT8CH\nUDSSGsYVolUtaAhXbIxo3+ptxHKkXoGgwoxO//RvOtxQW5CKjOtUDFy+9syH\nBeT6PqGM4DDR5Atc9/r3UCBhCWffBnxzTbip1Ld8F1oNONl3rY4l813TFi1+\nY751txw2HgciXCa7MT4NvtB4xkzVueNK4NCXcB1qHNtTpxFp5M3DKOZ2UQwr\nLHH2pcfGrah8VA1GcCEoCfU0yQtGD4yZwwnERMB/nt/gi5CHfZVgR1qNyzfC\n++3m5vIxaTxZEGOH/+xsynZQ7NgC7vefhNM3zNvT8OxdsiML55drPhnWNQLp\n+gIl3Vt+HAxfnub7qxRyP9MPFYTF3DEI1CForeUd8+W3mdlzSuw+iC0mvFw9\ntieVdONU4g9fbWVDDtXV1nihk+VWKHvf5pjTf3nWy4BKPjzJkK6Ncw6g55Hp\nHkdY\r\n=toG7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAWlUBuUlXv/30DKhH2CUuhQz92LMD4f32R3wrxEMQCAiAKVTAWYriBDjUTNyCjEZAtj+S0FbbnbfdaZzV5VyBwtQ=="}],"size":3839,"noattachment":false,"key":"/dargs/-/dargs-8.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dargs_8.0.0_1620053963357_0.8533845973652829"},"_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":1620053963465,"_cnpm_publish_time":1620053963465,"dist-tags":{"latest":"8.1.0"}}