{"_id":"argv-formatter","_rev":"4-ae0cc991cdb8e4f9c8411edae6d8da38","name":"argv-formatter","description":"Bizarro minimist: transform an options object into argv","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"argv-formatter","version":"1.0.0","description":"Bizarro minimist: transform an options object into argv","main":"./src","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/bendrucker/argv-formatter.git"},"keywords":["argv","formatting","child_process"],"author":{"name":"Ben Drucker","email":"bvdrucker@gmail.com","url":"http://bendrucker.me"},"license":"MIT","bugs":{"url":"https://github.com/bendrucker/argv-formatter/issues"},"homepage":"https://github.com/bendrucker/argv-formatter","devDependencies":{"chai":"~1.10.0","mocha":"~2.0.1"},"gitHead":"06092ed9d44510fe424fef847d96c950a9875d01","_id":"argv-formatter@1.0.0","_shasum":"a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"dist":{"shasum":"a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9","tarball":"https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz","integrity":"sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8GeBUrmQaSyK92oVs4Ohrk0sPsHre1UL9Wedxq6BJjAiEAl88vNMV+0PrcKpWCoiK+CCCC73Xsme8mwtdYLFD0IQA="}]}}},"readme":"argv-formatter\n==============\n\nBizarro [minimist](https://github.com/substack/minimist): transform an options object into into a `process.argv`-like array. Helpful for using `child_process` and passing complex arguments more easily. \n\n## Setup\n\n```bash\n$ npm install --save argv-formatter\n```\n\n## API\n\n#### `formatter.format(object)` -> `Array`\n\nAccepts an `object` of containing options and arguments and returns an array of arguments. \n\n* options with a value of `true` will be included with a flag only (`{R: true}` -> `['-R']`)\n* options that are falsey will be removed\n* all values will be stringified, (`{D: new Date(0)}` -> `['-D', 'Thurs Jan 1 1970...']`)\n* arguments can be passed under the `_` key as a value or array of values\n\n## Examples\n\nTo generate arguments to a `git log` command for printing the short hashes of commits that have changed our test files:\n```js\nvar args = formatter.format({\n  _: './test/*',\n  format: '%h'\n});\nconsole.log(args.join(' ')); // --format=%h ./test/*\n\n```\n\n[git-log-parser](https://github.com/bendrucker/git-log-parser) uses this to spawn a `git` process:\n\n```js\nvar spawn     = require('child_process').spawn;\nvar formatter = require('argv-formatter');\nvar args      = formatter.format(options);\nvar child     = spawn('git', ['log'].concat(args));\n```\n","maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"time":{"modified":"2022-06-13T03:26:39.996Z","created":"2014-11-23T18:16:21.898Z","1.0.0":"2014-11-23T18:16:21.898Z"},"homepage":"https://github.com/bendrucker/argv-formatter","keywords":["argv","formatting","child_process"],"repository":{"type":"git","url":"https://github.com/bendrucker/argv-formatter.git"},"author":{"name":"Ben Drucker","email":"bvdrucker@gmail.com","url":"http://bendrucker.me"},"bugs":{"url":"https://github.com/bendrucker/argv-formatter/issues"},"license":"MIT","readmeFilename":"README.md"}