{"_id":"@b4dnewz/object-to-argv","_rev":"4-3e7cc2b3b88c3dc0c8871a3d9e368aca","time":{"0.1.0":"2019-08-17T06:55:11.172Z","created":"2019-08-17T07:09:31.360Z","0.1.1":"2019-08-17T07:09:31.758Z","modified":"2022-04-04T17:24:29.207Z"},"name":"@b4dnewz/object-to-argv","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@b4dnewz/object-to-argv","version":"0.1.1","description":"Convert an object to a suitable argv array","homepage":"https://github.com/b4dnewz/object-to-argv","repository":{"type":"git","url":"git+https://github.com/b4dnewz/object-to-argv.git"},"main":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"prepublishOnly":"npm run build","prebuild":"npm run test","lint":"tslint -p . --fix","test":"jest --coverage","build":"tsc"},"author":{"name":"Filippo Conti","email":"filippo@codekraft.it","url":"https://b4dnewz.github.io/"},"license":"MIT","keywords":["argv","converter","conversion","object-conversion","cli-utility"],"devDependencies":{"@types/jest":"^24.0.16","coveralls":"^3.0.5","jest":"^24.8.0","ts-jest":"^24.0.2","tslint":"^5.18.0","typescript":"^3.5.3"},"publishConfig":{"access":"public"},"gitHead":"aa4ecce49de4c17c965aee806fcbe04579d00ea2","bugs":{"url":"https://github.com/b4dnewz/object-to-argv/issues"},"_id":"@b4dnewz/object-to-argv@0.1.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GggpTZ/JAn/G/kVufcsbvTj5+eKhKZbjH2jgG2dFM3NImVc5Cf6qC4r6HvVIALWyMAs9e9yn62Uwh0Ix9ZM/Gg==","shasum":"b1734d19546a223fcf4a1249f3b74b75ba4cef62","tarball":"https://registry.npmjs.org/@b4dnewz/object-to-argv/-/object-to-argv-0.1.1.tgz","fileCount":5,"unpackedSize":7764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdV6gsCRA9TVsSAnZWagAAC9YP/0AiYBjpWsOrtrX3Li7K\n/K2HTET30g5kf9+sYSNRnIUoQEMrvot2wgasGuqGlagYOWmtF/Xb08z5aS6q\nefQ8yABICgk7ZF+BdYlPCclVStNLoB2be9xEX3jN7EZSJw1M/O6ZXn34qrEX\nRXHbufrjOjweGpQ0bid25AlEno3dnoViPREp+vOYoZ5kjsM7zwGkgmX6zYQH\np/EXUGQy0ThUGZH/CXupRe8LH+FyZA46VI8BhVfS514KzAvMbdMYYpwg+L65\nHJQSyRYreRA2hiEGhsxQo485/x/NJeBZVGg/JRipCzG2FLfCPihUIpuIlKbA\nKXtjh3Iy8q2xWdHDEp5kURk2XhI0JKAp9PoPfwO3DyxcAQ/PFBIxHlYLZbn+\n994IOXsuXCaktw3NSm7Z1+EXvGjTH9mXqepzFFQ/OI8EwBQ2ljPqAi7y+FQp\nBEQDWg2LQMqunsb7JS6C3IvcuHF+wJxNYqlY18MDi/pPWFHkdmsJIG+3Ke2y\nc3EjvQs6aw42rNjaI9JlQjQuziT+5ZALS+ADNJ/zF3yArlqB6F7QkeTawdiy\nx8lq6PhohSd1eWRQ2KFfu6qlIkg2j/NgLPILecAul4j6a7gTslrd/HwxspVu\nnBU13DdeA+f1PpA3i78ndRcBKnrERg7lsfpXMTpeYI5lsnsM9dJY/jk7fxLM\nWT7P\r\n=N5SM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg0TEoI5RopMXYtE2FvWubrD9xM4+ZYgc3Oidc9kaS4QIgRgH1G5teA5wv/bv06ISXZ1JY6xk6Ptnu5ErxmCYTI14="}]},"maintainers":[{"name":"b4dnewz","email":"filippo@codekraft.it"}],"_npmUser":{"name":"b4dnewz","email":"filippo@codekraft.it"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/object-to-argv_0.1.1_1566025771581_0.4568084427167367"},"_hasShrinkwrap":false}},"maintainers":[{"name":"b4dnewz","email":"filippo@codekraft.it"}],"description":"Convert an object to a suitable argv array","homepage":"https://github.com/b4dnewz/object-to-argv","keywords":["argv","converter","conversion","object-conversion","cli-utility"],"repository":{"type":"git","url":"git+https://github.com/b4dnewz/object-to-argv.git"},"author":{"name":"Filippo Conti","email":"filippo@codekraft.it","url":"https://b4dnewz.github.io/"},"bugs":{"url":"https://github.com/b4dnewz/object-to-argv/issues"},"license":"MIT","readme":"# object-to-argv\r\n\r\n> Convert an object to a suitable argv array\r\n\r\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage percentage][coveralls-image]][coveralls-url]\r\n\r\n## Install\r\n\r\n```\r\nnpm install @b4dnewz/object-to-argv\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nimport objectToArgv from \"@b4dnewz/object-to-argv\"\r\n\r\nobjectToArgv({\r\n  c: true,\r\n  baz: false,\r\n  foo: \"bar\",\r\n  arr: [\"a\", \"b\"]\r\n})\r\n\r\n// [\"-c\", \"--no-baz\", \"--foo\", \"bar\", \"--arr\", \"a\", \"b\"]\r\n```\r\n\r\nYou can also add positional arguments setting the value to `null`\r\n\r\n```js\r\nobjectToArgv({\r\n  foo: null,\r\n  bar: true\r\n})\r\n\r\n// [\"foo\", \"--bar\"]\r\n```\r\n\r\n## Options\r\n\r\nHere a list of options that can be used when converting objects to argv array, simply pass them as second argument to the conversion function.\r\n\r\n__normalize__\r\n\r\nWhen enabled it will normalize the object key names and the final argv flags to kebab-case, by default is true.\r\n\r\n```js\r\nobjectToArgv({ fooBar: true })\r\n// [\"--foo-bar\"]\r\n\r\nobjectToArgv({ fooBar: true }, {\r\n  normalize: false\r\n})\r\n// [\"--fooBar\"]\r\n```\r\n\r\n__booleanNegation__\r\n\r\nWhen enabled it will add `--no` prefix before the boolean flags, otherwise if disabled it will simply omit the keys that have a falsy value, by default is true.\r\n\r\n```js\r\nobjectToArgv({ foo: false })\r\n// [\"--no-foo\"]\r\n\r\nobjectToArgv({ foo: false }, {\r\n  booleanNegation: false\r\n})\r\n// []\r\n```\r\n\r\n__arraySeparator__\r\n\r\nThis option allow to customize the separator used for array values, when false it will output each array element in it's own place, otherwise if is a string it will be used as separator.\r\n\r\n```js\r\nobjectToArgv({ foo: [\"bar\", \"baz\"] })\r\n// [\"--foo\", \"bar\", \"baz\"]\r\n\r\nobjectToArgv({ foo: [\"bar\", \"baz\"] }, {\r\n  arraySeparator: \",\"\r\n})\r\n// [\"--foo\", \"bar,baz\"]\r\n```\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT © [Filippo Conti](https://b4dnewz.github.io/)\r\n\r\n[npm-image]: https://badge.fury.io/js/%40b4dnewz%2Fobject-to-argv.svg\r\n[npm-url]: https://npmjs.org/package/@b4dnewz/object-to-argv\r\n[travis-image]: https://travis-ci.org/b4dnewz/object-to-argv.svg?branch=master\r\n[travis-url]: https://travis-ci.org/b4dnewz/object-to-argv\r\n[coveralls-image]: https://coveralls.io/repos/b4dnewz/object-to-argv/badge.svg\r\n[coveralls-url]: https://coveralls.io/r/b4dnewz/object-to-argv\r\n","readmeFilename":"README.md"}