{"name":"command-line-args","version":"6.0.2","description":"A mature, feature-complete library to parse command-line options.","repository":{"type":"git","url":"git+https://github.com/75lb/command-line-args.git"},"homepage":"https://github.com/75lb/command-line-args#readme","bugs":{"url":"https://github.com/75lb/command-line-args/issues"},"scripts":{"test":"npm run dist && npm run test:ci","test:ci":"test-runner test/*.js test/*.cjs test/internals/*.js","docs":"75lb-nature jsdoc2md index.js > doc/API.md && 75lb-nature jsdoc2md lib/option-definition.js > doc/option-definition.md","dist":"75lb-nature cjs-build index.js"},"type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["argv","parse","argument","args","option","options","parser","parsing","cli","command","line"],"author":{"name":"Lloyd Brookes","email":"opensource@75lb.com"},"license":"MIT","engines":{"node":">=12.20"},"dependencies":{"array-back":"^6.2.3","find-replace":"^5.0.2","lodash.camelcase":"^4.3.0","typical":"^7.3.0"},"peerDependencies":{"@75lb/nature":"latest"},"peerDependenciesMeta":{"@75lb/nature":{"optional":true}},"standard":{"ignore":["dist"],"envs":[]},"devDependencies":{"test-runner":"^0.10.1"},"gitHead":"b6657d972894006bf6224d40c6e0b84803f68cf2","_id":"command-line-args@6.0.2","_nodeVersion":"25.0.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-AIjYVxrV9X752LmPDLbVYv8aMCuHPSLZJXEo2qo/xJfv+NYhaZ4sMSF01rM+gHPaMgvPM0l5D/F+Qx+i2WfSmQ==","shasum":"a5b8a87d3f12aa1707c122c5ed38bc64535514a0","tarball":"http://registry-npm.ywwl.com/command-line-args/download/command-line-args-6.0.2.tgz","fileCount":13,"unpackedSize":68058,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCCFWPi8ll8C8FudA6gSq51kIPFEcgPEPrTyryX5h2XwwIhAN780ejzJOBiJLj0X/qWzmrWJWues2x7BGW0D7GiejaV"}],"size":15759,"noattachment":false,"key":"/command-line-args/-/command-line-args-6.0.2.tgz"},"_npmUser":{"name":"75lb","email":"opensource@75lb.com"},"directories":{},"maintainers":[{"name":"75lb","email":"opensource@75lb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/command-line-args_6.0.2_1774281032818_0.7590949161424176"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/command-line-args)](https://www.npmjs.org/package/command-line-args)\n[![npm module downloads](https://badgen.net/npm/dt/command-line-args)](https://www.npmjs.org/package/command-line-args)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/command-line-args)](https://github.com/75lb/command-line-args/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/command-line-args)](https://github.com/75lb/command-line-args/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/command-line-args/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/command-line-args/actions/workflows/node.js.yml)\n\n***Upgraders, please read the [release notes](https://github.com/75lb/command-line-args/releases)***\n\n# command-line-args\n\nA mature, feature-complete library to parse command-line options.\n\n## Synopsis\n\nYou can set options using the main notation standards ([learn more](https://github.com/75lb/command-line-args/wiki/Notation-rules)). These commands are all equivalent, setting the same values:\n```\n$ example --verbose --timeout=1000 --src one.js --src two.js\n$ example --verbose --timeout 1000 --src one.js two.js\n$ example -vt 1000 --src one.js two.js\n$ example -vt 1000 one.js two.js\n```\n\nTo access the values, first create a list of [option definitions](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) describing the options your application accepts. The [`type`](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md#optiontype--function) property is a setter function (the value supplied is passed through this), giving you full control over the value received.\n\n```js\nconst optionDefinitions = [\n  { name: 'verbose', alias: 'v', type: Boolean },\n  { name: 'src', type: String, multiple: true, defaultOption: true },\n  { name: 'timeout', alias: 't', type: Number }\n]\n```\n\nNext, parse the options using [commandLineArgs()](https://github.com/75lb/command-line-args/blob/master/doc/API.md#commandlineargsoptiondefinitions-options--object-):\n\n```js\nimport commandLineArgs from 'command-line-args'\nconst options = commandLineArgs(optionDefinitions)\n```\n\n`options` now looks like this:\n\n```js\n{\n  src: [\n    'one.js',\n    'two.js'\n  ],\n  verbose: true,\n  timeout: 1000\n}\n```\n\n### Advanced usage\n\nBeside the above typical usage, you can configure command-line-args to accept more advanced syntax forms.\n\n* [Command-based syntax](https://github.com/75lb/command-line-args/wiki/Implement-command-parsing-(git-style)) (git style) in the form:\n\n  ```\n  $ executable <command> [options]\n  ```\n\n  For example.\n\n  ```\n  $ git commit --squash -m \"This is my commit message\"\n  ```\n\n* [Command and sub-command syntax](https://github.com/75lb/command-line-args/wiki/Implement-multiple-command-parsing-(docker-style)) (docker style) in the form:\n\n  ```\n  $ executable <command> [options] <sub-command> [options]\n  ```\n\n  For example.\n\n  ```\n  $ docker run --detached --image centos bash -c yum install -y httpd\n  ```\n\n## Usage guide generation\n\nA usage guide (typically printed when `--help` is set) can be generated using [command-line-usage](https://github.com/75lb/command-line-usage). See the examples below and [read the documentation](https://github.com/75lb/command-line-usage) for instructions how to create them.\n\nA typical usage guide example.\n\n![usage](https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/footer.png)\n\nThe [polymer-cli](https://github.com/Polymer/polymer-cli/) usage guide is a good real-life example.\n\n![usage](https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/polymer.png)\n\n## Further Reading\n\nThere is plenty more to learn, please see [the wiki](https://github.com/75lb/command-line-args/wiki) for examples and documentation.\n\n## Install\n\n```sh\n$ npm install command-line-args --save\n```\n* * *\n\n&copy; 2014-26 [Lloyd Brookes](https://github.com/75lb) \\<opensource@75lb.com\\>.\n\nDocumented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1774281032960,"_cnpm_publish_time":1774281032960,"dist-tags":{"latest":"6.0.2"}}