{"id":18573901,"url":"https://github.com/basedwon/arrrg","last_synced_at":"2025-10-12T13:25:42.340Z","repository":{"id":57684944,"uuid":"482153345","full_name":"basedwon/arrrg","owner":"basedwon","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-28T04:44:12.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-18T04:56:37.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/basedwon.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":"2022-04-16T04:18:33.000Z","updated_at":"2022-04-16T04:20:10.000Z","dependencies_parsed_at":"2022-09-17T00:23:15.428Z","dependency_job_id":null,"html_url":"https://github.com/basedwon/arrrg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/basedwon/arrrg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basedwon%2Farrrg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basedwon%2Farrrg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basedwon%2Farrrg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basedwon%2Farrrg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basedwon","download_url":"https://codeload.github.com/basedwon/arrrg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basedwon%2Farrrg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011465,"owners_count":26084947,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-06T23:13:21.068Z","updated_at":"2025-10-12T13:25:42.312Z","avatar_url":"https://github.com/basedwon.png","language":"JavaScript","readme":"# Arrrg\n\n`arrrg` is a simple CLI argument parser.\n\n## Installation\n\n```sh\nnpm install arrrg\n```\n\n## Usage\n\n`arrrg(definition, [defaults], [examples], [argv])`\n\n## Example\n\n```js\nconst Arrrg = require('arrrg')\n\nconst definition = [\n  { name: 'servn', type: String, command: true, default: '.', swap: 'docroot' },\n  { name: 'host', type: String, help: 'define the host', default: 'localhost' },\n  { name: 'file', type: String, aliases: ['f'], help: 'define the file', default: 'main.js' },\n  { name: 'port', type: Number, aliases: ['p'], help: 'define the port', default: 8080 },\n  { name: 'cert', help: 'define the TLS cert' },\n  { name: 'help', type: Boolean, aliases: ['h', 'help'], help: 'show this dialog' },\n]\nconst defaults = {\n  host: 'localhost',\n  file: 'main.js'\n}\nconst examples = [\n  `servn`,\n  `servn -p 3000`,\n  `servn ~/project --host example.com --file index.js`,\n]\nconst argv = ['.', '--cert', 'localhost-key.pem', '--help']\nconst opts = Arrrg(definition, defaults, examples, argv)\n\nconsole.log(opts)\n/*\n{\n  _: [],\n  servn: '.',\n  cert: 'localhost-key.pem',\n  help: true,\n  host: 'localhost',\n  file: 'main.js',\n  port: 8080\n}\n*/\n\nif (opts.help)\n  return opts.showHelp() // showHelp result:\n/*\n  Servn\n\n  Usage: servn ...args [options]\n\n  Options:\n    --host      define the host\n    -f, --file  define the file\n    -p, --port  define the port\n    --cert      define the TLS cert\n    -h, --help  show this dialog\n\n  Examples:\n    servn\n    servn -p 3000\n    servn ~/project --host example.com --file index.js\n*/\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasedwon%2Farrrg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasedwon%2Farrrg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasedwon%2Farrrg/lists"}