{"id":25008728,"url":"https://github.com/snvfk1n/argv-options","last_synced_at":"2026-05-18T11:05:21.572Z","repository":{"id":57183613,"uuid":"79651244","full_name":"snvfk1n/argv-options","owner":"snvfk1n","description":"opinionated argv options parser","archived":false,"fork":false,"pushed_at":"2017-02-23T13:05:59.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T09:15:50.756Z","etag":null,"topics":["args","cli","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/snvfk1n.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":"2017-01-21T14:41:24.000Z","updated_at":"2023-02-16T21:52:56.000Z","dependencies_parsed_at":"2022-08-23T01:31:21.500Z","dependency_job_id":null,"html_url":"https://github.com/snvfk1n/argv-options","commit_stats":null,"previous_names":["fallafeljan/argv-options","snvfk1n/argv-options","jankaszel/argv-options"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/snvfk1n/argv-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fargv-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fargv-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fargv-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fargv-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snvfk1n","download_url":"https://codeload.github.com/snvfk1n/argv-options/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fargv-options/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265836845,"owners_count":23836525,"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":["args","cli","nodejs"],"created_at":"2025-02-05T03:23:49.411Z","updated_at":"2026-05-18T11:05:16.545Z","avatar_url":"https://github.com/snvfk1n.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# argv-options\n\n[![npm](https://img.shields.io/npm/v/argv-options.svg)](https://www.npmjs.com/package/argv-options)\n[![Travis](https://travis-ci.org/fallafeljan/argv-options.svg)]()\n\n`argv-options` subjectively parses your `argv` options, i.e., it makes\nassumptions about how your CLI is designed to keep the API simple. It expects your `argv` object to be supplied in the format of `-p foo --param bar`, i.e., \nsimple key-value arguments that may be aliased (using `--`).\n\n## API \n\n`parseOptions(argv, options)`\n\nThis method will return the parsed options in a key-value based object,\nincluding all found options and their respective aliases. The following\narugments are mandatory:\n\n* `argv` The arguments array, as space-split array of all parameters. In your\n  average usage case, passing `process.argv.slice(2)` will do.\n* `options` The possible options, as object:\n\n```json\n{\n  \"p\": {\n    \"optional\": false,\n    \"alias\": \"param\"\n  },\n\n  \"a\": {\n    \"optional\": true,\n    \"alias\": \"argument\"\n  }\n}\n```\n\nParameters are required (`optional` is false) by default. Alternatively, for \nmore convenient use, aliases may be specified by using the key's value:\n\n```json\n{\n  \"p\": \"param\"\n}\n```\n\nIf any non-optional parameters are missing or undocumented parameters occur,\n`parseOptions` will throw an error.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnvfk1n%2Fargv-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnvfk1n%2Fargv-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnvfk1n%2Fargv-options/lists"}