{"id":15844795,"url":"https://github.com/fabervitale/deno_minimist","last_synced_at":"2026-05-01T14:33:44.156Z","repository":{"id":62420937,"uuid":"267647121","full_name":"FaberVitale/deno_minimist","owner":"FaberVitale","description":"💾 Parses command line arguments. Port \u0026 rewrite of the node library minimist","archived":false,"fork":false,"pushed_at":"2020-10-03T14:18:05.000Z","size":44,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T04:20:01.668Z","etag":null,"topics":["cli","deno","minimist","parser","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FaberVitale.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-28T17:00:50.000Z","updated_at":"2024-12-10T20:23:55.000Z","dependencies_parsed_at":"2022-11-01T17:30:56.149Z","dependency_job_id":null,"html_url":"https://github.com/FaberVitale/deno_minimist","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno_minimist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno_minimist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno_minimist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno_minimist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FaberVitale","download_url":"https://codeload.github.com/FaberVitale/deno_minimist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246682748,"owners_count":20817126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","deno","minimist","parser","typescript"],"created_at":"2024-10-05T17:40:51.564Z","updated_at":"2026-05-01T14:33:44.111Z","avatar_url":"https://github.com/FaberVitale.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno_minimist\n\n💾 Parses command line arguments. \n\nPort \u0026 rewrite to [deno](https://deno.land/) \u0026 [typescript](https://www.typescriptlang.org/) of the node library [minimist](https://github.com/substack/minimist).\n\n---\n\n## example\n\n```typescript\n// parse.ts\nimport parseArgs from 'https://deno.land/x/deno_minimist@v1.0.2/mod.ts';\n\nparseArgs(Deno.args);\n```\n\n```bash\n$ deno run ./examples/parse.ts -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```bash\n$ deno run ./examples/parse.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\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## API\n\n```typescript\nimport parseArgs from 'https://deno.land/x/deno_minimist@v1.0.2/mod.ts';\n\nparseArgs(Deno.args);\n```\n\n## const argv = parseArgs(args, opts={})\n\nReturns 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\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\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n\n* `opts.default` - an object mapping string argument names to default values\n\n* `opts.stopEarly` - when true, populate `argv._` with everything after the\nfirst non-option\n\n* `opts['--']` - when true, populate `argv._` with everything before the `--`\nand `argv['--']` with everything after the `--`. Here's an example:\n\n```typescript\nimport parseArgs from 'https://deno.land/x/deno_minimist@v1.0.2/mod.ts';\n\nparseArgs('one two three -- four five --six'.split(' '), {'--': true });\n```\n\nNote 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---\n\n## Relevant changes compared to minimist\n\n* An explicit TypeError is raised if the input is falsy.\n\n* `--constructor` option is supported.\n\n* Added few tests.\n\n* Improved accuracy and ergonomics of typescript types.\n\n* The returned payload is an object created using `Object.create(null)`, hence \n  does not have instance methods like `toString`:\n  \n```typescript\nimport parseArgs from 'https://deno.land/x/deno_minimist@v1.0.2/mod.ts';\n\nparse(Deno.args).toString(); // BAD - `TypeError: parse(...).toString is not a function`\nparse(Deno.args) + \"\";       // BAD - `TypeError: parse(...).toString is not a function`\n\nObject.prototype.toString.call(parse(Deno.args)); // OK `[object Object]`\n\nJSON.stringify(parse(['--foo'])); // OK `{\"_\":[],\"foo\":true}`\n```\n\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabervitale%2Fdeno_minimist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabervitale%2Fdeno_minimist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabervitale%2Fdeno_minimist/lists"}