{"id":49090446,"url":"https://github.com/ayumosa/kitsune","last_synced_at":"2026-05-28T17:04:22.878Z","repository":{"id":114513159,"uuid":"543986155","full_name":"ayumosa/kitsune","owner":"ayumosa","description":"Yet another argument parser","archived":false,"fork":false,"pushed_at":"2022-10-13T16:31:52.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-30T07:31:06.986Z","etag":null,"topics":["argument-parser","javascript","node","node-js","nodejs","parse","parser","yet-another"],"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/ayumosa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-01T10:33:33.000Z","updated_at":"2022-10-16T13:22:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"ead6db40-db74-48f9-80e0-6b7a8cdf4683","html_url":"https://github.com/ayumosa/kitsune","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"6616b0a8239429660cd934151a4d56e3838df8a7"},"previous_names":["ayumosa/kitsune","somucheffort/kitsune"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayumosa/kitsune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayumosa%2Fkitsune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayumosa%2Fkitsune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayumosa%2Fkitsune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayumosa%2Fkitsune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayumosa","download_url":"https://codeload.github.com/ayumosa/kitsune/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayumosa%2Fkitsune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32059139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["argument-parser","javascript","node","node-js","nodejs","parse","parser","yet-another"],"created_at":"2026-04-20T18:01:55.166Z","updated_at":"2026-04-20T18:01:56.281Z","avatar_url":"https://github.com/ayumosa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kitsune\nkitsune is yet another argument parser, which was introduced in [@modularium/fox](https://github.com/modularium/fox).\n\n```sh\n$ npm i @sooomucheffort/kitsune\n$ yarn add @sooomucheffort/kitsune\n```\n\n## Example\n\n```js\nconst { KitsuneParser, KitsuneParserError, KitsuneParserType } = require('@sooomucheffort/kitsune')\n\nconst kp = new KitsuneParser()\n\ntry {\n  const parsed = kp.parse(\n    [\n      'first argument', \n      2,\n      false\n    ], \n    [\n      {\n        type: KitsuneParserType.STRING\n      }, \n      {\n        type: KitsuneParserType.NUMBER\n      }, \n      {\n        type: KitsuneParserType.BOOLEAN\n      }\n    ]\n  )\n\n  console.log(parsed)\n} catch (e) {\n  if (e instanceof KitsuneParserError) {\n    console.log(e)\n    // ...\n  } else {\n    // ...\n  }\n}\n```\n\n## Types\n\n### Standard ones\n`KitsuneParserType` has 3 standard types, which include `KitsuneParserType.STRING`, `KitsuneParserType.NUMBER`, `KitsuneParserType.BOOLEAN`\n\n### Creating your own\n```js\nconst { KitsuneParserType } = require('@sooomucheffort/kitsune')\n\nconst type = new KitsuneParserType(\n  'name', \n  val =\u003e /* validate the value */,\n  val =\u003e /* transform the value */\n)\n```\n\n## Options for an argument\n\nYou can add your options:\n```js\n// This will throw an error because value isn't a string EXPLICITLY, otherwise it will transform any object to string value\nconst parsed = kp.parse(\n  [\n    false\n  ], \n  [\n    {\n      type: KitsuneParserType.STRING,\n      explicit: true\n    }\n  ]\n)\n```\n\n### `count: -1`\nThis option will collect all other arguments in one\n```js\nconst parsed = kp.parse(\n  [\n    'hi',\n    1,\n    2,\n    3\n  ], \n  [\n    {\n      type: KitsuneParserType.STRING\n    },\n    {\n      type: KitsuneParserType.NUMBER,\n      count: -1\n    }\n  ]\n)\n\nconsole.log(parsed) // [ 'hi', [ 1, 2, 3 ] ]\n```\n\n### `required: false`\nWith this option, if a type doesn't validate this value it will just ignore it\n```js\nconst oddOrEven = new KitsuneParserType('oddOrEven', \n    (val, opts) =\u003e !opts.required || Number.isInteger(val), \n    val =\u003e Number.isInteger(val) ? (parseInt(val) % 2) !== 1 ? 'even' : 'odd' : 'neither'\n)\n\n/*\nconst oddOrEven = new KitsuneParserType('oddOrEven', \n    val =\u003e Number.isInteger(val), \n    val =\u003e (parseInt(val) % 2) !== 1\n)\n*/\n\nconst parsed = kp.parse(\n  [\n    1,\n    'string'\n  ], \n  [\n    {\n      type: oddOrEven\n    },\n    {\n      type: oddOrEven,\n      required: false\n    }\n  ]\n)\n\nconsole.log(parsed) // [ 'odd', 'neither' ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayumosa%2Fkitsune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayumosa%2Fkitsune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayumosa%2Fkitsune/lists"}