{"_id":"@1n/argv","_rev":"3-6890ebb07151727b771e6883280a9fbc","name":"@1n/argv","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@1n/argv","version":"0.0.1","keywords":[],"author":{"name":"scriptpower"},"license":"MIT","_id":"@1n/argv@0.0.1","maintainers":[{"name":"scriptpower","email":"scriptpower@qq.com"},{"name":"leiyl","email":"leiyl@outlook.com"}],"dist":{"shasum":"fd332d7b2fb853055410e4ead2ca4640cc4096a1","tarball":"https://registry.npmjs.org/@1n/argv/-/argv-0.0.1.tgz","fileCount":5,"integrity":"sha512-TKYCe4BpHAnxPO9A+Rqj4K5ZNmQ5GuUVOLsFPMLYAWPwJXTjk6YawiXOsT5H7tikom0b6OPu4YF5iUjc1S1/ew==","signatures":[{"sig":"MEMCIHjmjC7IinuoyK/E2LNUmepj86WA1c0iNYNQ3fVaW1m9Ah8FX9gvQT/LyPltHdbvWPHoQUM6loDB2NVQdeP8rRLu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9652},"main":"index.js","type":"module","types":"index.d.ts","module":"index.js","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.ts","default":"./index.cjs"}}},"gitHead":"7f7cd6a1c5481fd57277c2ce07b7ce254aa58869","_npmUser":{"name":"scriptpower","email":"scriptpower@qq.com"},"_npmVersion":"10.2.4","description":"Parse argument options","directories":{},"_nodeVersion":"20.9.0","dependencies":{"kit-types":"^0.0.5","@1k/shared":"^0.1.12"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/argv_0.0.1_1701421689040_0.11108321364873253","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@1n/argv","version":"0.0.2","keywords":[],"author":{"name":"scriptpower"},"license":"MIT","_id":"@1n/argv@0.0.2","maintainers":[{"name":"scriptpower","email":"scriptpower@qq.com"},{"name":"leiyl","email":"leiyl@outlook.com"}],"dist":{"shasum":"0749028950cefc9250573d2f7888402ca9f29ec0","tarball":"https://registry.npmjs.org/@1n/argv/-/argv-0.0.2.tgz","fileCount":5,"integrity":"sha512-c5DyQ5RADNOJCSLG2+fm4b0pYONkOItDW2GtHlKtroZVeHd5EbZHpVF97xTpsh5evQuXVZSRjybwwkWvMf3vtw==","signatures":[{"sig":"MEQCIDZS+mZXSS1xoX8Ty90UCeRMf2VzQfrdQZWa1P5dxiLMAiAw7I9Q5TnDzcTXUkKwEw5i2hiiPKLjVcbacqy3kGqrwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10552},"main":"index.js","type":"module","types":"index.d.ts","module":"index.js","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.ts","default":"./index.cjs"}}},"gitHead":"96ca7bec27ef3670db2e9b7f921ab3cfe4206a68","_npmUser":{"name":"scriptpower","email":"scriptpower@qq.com"},"_npmVersion":"10.4.0","description":"Parse argument options","directories":{},"_nodeVersion":"20.10.0","dependencies":{"@1k/shared":"^0.1.12"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/argv_0.0.2_1711677814463_0.6039994598442364","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@1n/argv","version":"0.0.3","description":"Parse argument options","keywords":["argv","argument","parse"],"author":{"name":"scriptpower"},"type":"module","main":"lib/index.cjs","module":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=18"},"publishConfig":{"registry":"https://registry.npmjs.com/","access":"public"},"license":"MIT","_id":"@1n/argv@0.0.3","gitHead":"54625345931b14672b1da776a71ea511f052d197","_nodeVersion":"23.7.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-MeoCIZW2PS5NoW2hhyb/a74h8d9dRm/2XEY382xg9jeDD02zqS+J90VyIoc6i9BxGmTlEsQ3ihxjIE3AgWhxCg==","shasum":"270f9ed1420f38422f292af7d66f35a863a61236","tarball":"https://registry.npmjs.org/@1n/argv/-/argv-0.0.3.tgz","fileCount":5,"unpackedSize":10756,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFYgEgRqrYMYER6HUjqK6Xn6171cd8Sh6zt3kKyz6iNJAiEAm2mIjE+ablDDvf4exMWhjq/njnQeiCa6GUf6IhOOyJc="}]},"_npmUser":{"name":"scriptpower","email":"scriptpower@qq.com"},"directories":{},"maintainers":[{"name":"scriptpower","email":"scriptpower@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/argv_0.0.3_1740802488885_0.5665296233440715"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-01T09:08:08.953Z","modified":"2025-03-01T04:14:49.279Z","0.0.1":"2023-12-01T09:08:09.215Z","0.0.2":"2024-03-29T02:03:34.584Z","0.0.3":"2025-03-01T04:14:49.072Z"},"author":{"name":"scriptpower"},"license":"MIT","keywords":["argv","argument","parse"],"description":"Parse argument options","maintainers":[{"name":"scriptpower","email":"scriptpower@qq.com"}],"readme":"# @1n/argv\n\nparse command line arguments.\n\n## example\n\n``` js\n// example/parse.js\nimport { argv } from 'node:process'\nimport { parse } from '@1n/argv'\nconst parsed = parse(argv.slice(2));\nconsole.log(parsed);\n```\n\n```sh\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```sh\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{\n  _: ['foo', 'bar', 'baz'],\n  x: 3,\n  y: 4,\n  n: 5,\n  a: true,\n  b: true,\n  c: true,\n  beep: 'boop'\n}\n```\n\n## methods\n\n``` js\nimport { parse } from '@1n/argv'\n```\n\n### var argv = parse(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a boolean, string or array of strings to always treat as\nbooleans. if `true` will treat all double hyphenated arguments without equal signs\nas boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n* `opts.stopEarly` - when true, populate `argv._` with everything after the\nfirst non-option\n* `opts['--']` - when true, populate `argv._` with everything before the `--`\nand `argv['--']` with everything after the `--`. Here's an example:\n\n```js\nimport { parse } from '@1n/argv'\nparse('one two three -- four five --six'.split(' '), { '--': true })\n{\n  _: ['one', 'two', 'three'],\n  '--': ['four', 'five', '--six']\n}\n```\n\n  Note that with `opts['--']` set, parsing for arguments still stops after the\n  `--`.\n\n* `opts.unknown` - a function which is invoked with a command line parameter not\ndefined in the `opts` configuration object. If the function returns `false`, the\nunknown option is not added to `argv`.\n\n## install\n\nWith [npm](https://npmjs.org) do:\n\n```sh\nnpm i @1n/argv\n```\n\nWith [pnpm](https://pnpmjs.io) do:\n\n```sh\npnpm i @1n/argv\n```\n\n## license\n\nMIT\n","readmeFilename":"README.md"}