{"name":"dargs","version":"8.1.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":"42150c59a5a9f5986b379b152f47ac390a2aa1e6","bugs":{"url":"https://github.com/sindresorhus/dargs/issues"},"homepage":"https://github.com/sindresorhus/dargs#readme","_id":"dargs@8.1.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"integrity":"sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==","shasum":"a34859ea509cbce45485e5aa356fef70bfcc7272","tarball":"http://registry-npm.ywwl.com/dargs/download/dargs-8.1.0.tgz","fileCount":5,"unpackedSize":12261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3Ap3CRA9TVsSAnZWagAAiasP/1BEuxnNdBqvCNHPog4u\nwLRUMt+4/Ei6h3CNQplHuSDjuKDBOE/JCfOLoIowCHefV9B/gDrODy1j6JJr\n0nIuKrU+C+W4e5ZQQgkCayMFuJjhDt+HCBEonIOxb+1ZufXeiPC+lmEhcp+A\nHqCi/d7AO5S1lLSIme/8w9KqOcGSc/pwZMaoTIUOldZssouwqsNaiP7KmSwa\ndmB7qG1Luyx1zjsn8s+sqMqVysUjbCNtZQbZoOJja1iFux6dqqhOq65i7BtG\nM6zcXLUa+KGIg3p/VBF6TT4V/dIMXN5/bB8gsPMQ9S5dHpUIioN1xW1ZxW1z\nSCTEOHg0GDM6yZ1WRFjgVY2eFegKmVjejeYrfi5sYh9MlpghRaXLCzDI1Yt/\nWlJvsTa5+bOnMsku5cSkvbHlqMx7qPQZhNmXRsTlBvz87+fsXyt9unktMaUL\nSO5wGx6bJ4WtaqF77+CjuiluR/9q6C4Revp8VYHrC9LSBqBjlKYjvTCqEWRH\n/R7FCGz832xPewLQF1XyhvmpdJEfawpXzKfb6oElTsvAmAB5avse4yBvLYSk\nQK+AJ58ZeULs2a/PrLHD71qbtc4xW7QiinPy0UKWMC2lHbvQlVm4OHCOiiZY\n//0WnlxMXZlfqYtFghCvCWo46NdBPtKpMABQRQebysaLYkU+zB8k20XULJwo\nZ97I\r\n=GwYl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYzHDpx3rxyaoBv/uixhP9Cv/Z7iIySWQktIOq3B8zVAIhAIQ5qSkg4EKUDs76b4fSPFIp/RKsJ79484IMQXGNzMtK"}],"size":3876,"noattachment":false,"key":"/dargs/-/dargs-8.1.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.1.0_1625033335487_0.3675947660200256"},"_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":1625033335643,"_cnpm_publish_time":1625033335643,"dist-tags":{"latest":"8.1.0"}}