{"versions":{"0.0.2":{"name":"argv","description":"","url":"http://codenothing.github.com/argv/","keywords":["cli","argv","options"],"author":{"name":"Corey Hart","email":"corey@codenothing.com"},"version":"0.0.2","main":"./index.js","engines":{"node":">=0.6.10"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"nlint":"0.0.4","munit":"0.0.5"},"readmeFilename":"README.md","_id":"argv@0.0.2","dist":{"shasum":"ecbd16f8949b157183711b1bda334f37840185ab","size":7713,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/argv/-/argv-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"anonymous","email":"corey@codenothing.com"},"maintainers":[{"name":"anonymous","email":"corey@codenothing.com"}],"directories":{},"publish_time":1368954291012,"_hasShrinkwrap":false,"_cnpm_publish_time":1368954291012,"contributors":[]},"0.0.1":{"name":"argv","description":"","url":"http://codenothing.github.com/argv/","keywords":["cli","argv","options"],"author":{"name":"Corey Hart","email":"corey@codenothing.com"},"version":"0.0.1","main":"./index.js","engines":{"node":">=0.6.10"},"dependencies":{},"devDependencies":{"nlint":"0.0.1"},"_npmUser":{"name":"anonymous","email":"corey@codenothing.com"},"_id":"argv@0.0.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"0983be279d7a97d9c1e825c953c893f0d105aa5e","size":5512,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/argv/-/argv-0.0.1.tgz"},"maintainers":[{"name":"anonymous","email":"corey@codenothing.com"}],"directories":{},"publish_time":1341786733731,"_hasShrinkwrap":false,"_cnpm_publish_time":1341786733731,"contributors":[]},"0.0.3":{"name":"argv","version":"0.0.3","description":"CLI Argument Parser","author":{"name":"Corey Hart","email":"corey@codenothing.com"},"main":"./index.js","license":"MIT","homepage":"http://codenothing.github.com/argv/","repository":{"type":"git","url":"git://github.com/codenothing/argv.git"},"keywords":["cli","argv","options"],"engines":{"node":">=0.6.10"},"scripts":{"clean":"rm -rf build/results","lint":"node build/lint.js","test":"npm run clean && npm run lint && node build/test.js"},"dependencies":{},"devDependencies":{"nlint":"0.0.6","munit":"0.0.7"},"gitHead":"d5547ac9efb13eaec7eaa68bb65f5dd691793e34","bugs":{"url":"https://github.com/codenothing/argv/issues"},"_id":"argv@0.0.3","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-T/78+mAFUtUoCCdEiXzMwumwX490tUCQwMiKrr2DVEM90uvkiQqI3izIF5GXgCDAet1NAlPsKTV63wNc4wuIag==","shasum":"10896017133223ef6b4f12426eafb9d227112596","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/argv/-/argv-0.0.3.tgz","fileCount":6,"unpackedSize":16759,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9uAXaprUFibauDlQx2gEcW/QiI0xfpxZczKRYwD54lAiAvwlYyJv4JGCd2/9cp0Nfq5fJFE9RktznGjMOlG/yLeg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1pVFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTPA//QtGWnjfFpjnGt46HWUBJ1G0/MOD1sRh9T4TRohzZSBKjbbuY\r\na5rKRyzXmZe5VJ1SinKWJjHS30GyLn40UP8Znge6HeoxaQ0R/ZRRHphm1fgw\r\naiAXCzOo5OA6DK3oJrk3EYEvBh+OiN9wObPkgeBF5GGAx8yY6GwF76sBztcZ\r\ngclziIniVx1VEYhQfFQPsgZ2JakrRpd18E7IMc8eVuVq4oRdO3gI4Al65NbN\r\nPAHEeUg7pBgpw7JhKl2z5BE4KgKqFZKZ6FfY4UNbOXDEZaIn0JaKa8AnRaOm\r\n8sP8Raf4T95+qXDYuiIS5SP32uWRXNc9+jmLqYhBgx7mCKje3nrs+YvESOI7\r\nxp3V0rqRwJRDUFf9lFi4RHeL6s1ntgcybvdUwP9HGtbRw5w9YHJxtH2lOplr\r\nhbw3qe5mUrZTr+QOcmBla9kxcnucyAALSwMx9S8attdrJWTzIQZzASEe40AM\r\nuV1ZMc9Cmk8bcre9uB0GI4XeMLjIJr+8w1QXncgO04yyrE/izID29dQHU+3G\r\nWsHxnWKKqdiVILWhdAd53MJ50SrLBEb1JGS1rrp+yx5fxOx1+A+1nP4r9OsQ\r\na70HWSOimLfJgLg/4d33EroR3/NzuOd31D7gKA+KA8R4YuSXa7ZpdjFxFiUO\r\ny2zQkos1FfzYtw+V/vsz3GCANoDkXsncFo4=\r\n=ZXZk\r\n-----END PGP SIGNATURE-----\r\n","size":5902},"_npmUser":{"name":"anonymous","email":"corey@codenothing.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"corey@codenothing.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/argv_0.0.3_1675007300844_0.9350178164432483"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_cnpmcore_publish_time":"2023-01-29T15:48:21.033Z","publish_time":1675007301033,"contributors":[]}},"dist-tags":{"latest":"0.0.3"},"name":"argv","time":{"modified":"2023-03-22T13:41:55.796Z","created":"2022-01-26T13:45:31.480Z","0.0.2":"2013-05-19T09:04:51.012Z","0.0.1":"2012-07-08T22:32:13.731Z","0.0.3":"2023-01-29T15:48:21.033Z"},"readme":"[![NPM version](https://badge.fury.io/js/argv.png)](http://badge.fury.io/js/argv) ![Test Runner](https://github.com/codenothing/argv/actions/workflows/main.yml/badge.svg) [![Code Climate](https://codeclimate.com/github/codenothing/argv.png)](https://codeclimate.com/github/codenothing/argv)\n\n# argv\n\n`argv` is a simple, zero dependency, command line argument parser for NodeJS. For a more feature-full CLI parser, checkout [Commander.js](https://www.npmjs.com/package/commander) or [Yargs](https://www.npmjs.com/package/yargs)\n\n### Installation\n\n```bash\n$ npm install argv\n```\n\n### Usage\n\n```js\nvar argv = require( 'argv' );\nvar args = argv.option( options ).run();\n-> { targets: [], options: {} }\n```\n\n### Run\n\nRuns the argument parser on the global arguments. Custom arguments array can be used by passing into this method\n\n```js\n// Parses default arguments 'process.argv.slice( 2 )'\nargv.run();\n\n// Parses array instead\nargv.run([\"--option=123\", \"-o\", \"123\"]);\n```\n\n### Options\n\n`argv` is a strict argument parser, which means all options must be defined before parsing starts.\n\n```js\nargv.option({\n  name: \"option\",\n  short: \"o\",\n  type: \"string\",\n  description: \"Defines an option for your script\",\n  example: \"'script --option=value' or 'script -o value'\",\n  onset: function (args) {\n    args; // Object of current arguments parsed\n  },\n});\n```\n\n### Modules\n\nModules are nested commands for more complicated scripts. Each module has it's own set of options that\nhave to be defined independently of the root options.\n\n```js\nargv.mod({\n\tmod: 'module',\n\tdescription: 'Description of what the module is used for',\n\toptions: [ list of options ]\n});\n```\n\n### Types\n\nTypes convert option values to useful JS objects. They are defined along with each option.\n\n- `string`: Ensure values are strings\n- `path`: Converts value into a fully resolved path.\n- `integer | int`: Converts value into an integer\n- `float`: Converts value into a float number\n- `boolean | bool`: Converts value into a boolean object. 'true' and '1' are converted to true, everything else is false.\n- `csv`: Converts value into an array by splitting on comma's.\n- `list`: Allows for option to be defined multiple times, and each value added to an array\n- `[list|csv],[type]`: Combo type that allows you to create a list or csv and convert each individual value into a type.\n\n```js\nargv.option([\n\t{\n\t\tname: 'option',\n\t\ttype: 'csv,int'\n\t},\n\t{\n\t\tname: 'path',\n\t\tshort: 'p',\n\t\ttype: 'list,path'\n\t}\n]);\n\n// csv and int combo\n$ script --option=123,456.001,789.01\n-> option: [ 123, 456, 789 ]\n\n// list and path combo\n$ script -p /path/to/file1 -p /path/to/file2\n-> option: [ '/path/to/file1', '/path/to/file2' ]\n```\n\nYou can also create your own custom type for special conversions.\n\n```js\nargv.type( 'squared', function( value ) {\n\tvalue = parseFloat( value );\n\treturn value * value;\n});\n\nargv.option({\n\tname: 'square',\n\tshort: 's',\n\ttype: 'squared'\n});\n\n$ script -s 2\n-> 4\n```\n\n### Version\n\nDefining the scripts version number will add the version option and print it out when asked.\n\n```js\nargv.version( 'v1.0' );\n\n$ script --version\nv1.0\n\n```\n\n### Info\n\nCustom information can be displayed at the top of the help printout using this method\n\n```js\nargv.info( 'Special script info' );\n\n$ script --help\n\nSpecial script info\n\n... Rest of Help Doc ...\n```\n\n### Clear\n\nIf you have competing scripts accessing the `argv` object, you can clear out any previous options that may have been set.\n\n```js\nargv.clear().option([new options()]);\n```\n\n### Help\n\n`argv` injects a default help option initially and on clears. The help() method triggers the help printout.\n\n```js\nargv.help();\n```","users":{}}