{"id":13485139,"url":"https://github.com/egoist/router","last_synced_at":"2025-09-05T18:49:18.113Z","repository":{"id":45275433,"uuid":"347399630","full_name":"egoist/router","owner":"egoist","description":"A router that works in Node.js, browser and Deno.","archived":false,"fork":false,"pushed_at":"2021-12-25T14:00:48.000Z","size":125,"stargazers_count":65,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T14:51:12.295Z","etag":null,"topics":[],"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/egoist.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":"2021-03-13T14:59:17.000Z","updated_at":"2024-11-04T23:52:22.000Z","dependencies_parsed_at":"2022-08-30T17:11:59.534Z","dependency_job_id":null,"html_url":"https://github.com/egoist/router","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Frouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Frouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Frouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Frouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/router/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251675385,"owners_count":21625804,"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":[],"created_at":"2024-07-31T17:01:47.360Z","updated_at":"2025-04-30T09:24:10.804Z","avatar_url":"https://github.com/egoist.png","language":"TypeScript","funding_links":["https://github.com/sponsors/egoist"],"categories":["TypeScript"],"sub_categories":[],"readme":"# @egoist/router\n\nAn Express-like router that works in Node.js, browser and Deno.\n\n## Install\n\nFor Node.js:\n\n```bash\nnpm i @egoist/router\n```\n\n```ts\nimport { Router } from '@egoist/router'\n```\n\nFor Deno:\n\n```ts\nimport { Router } from 'https://unpkg.com/@egoist/router/mod.js'\n```\n\n## Usage\n\n```ts\nconst router = new Router()\n\nrouter.get('/user/:user', (params) =\u003e {\n  console.log(params.user)\n})\n\nrouter.get('/', () =\u003e {\n  // do something\n})\n\nconst matches = router.find('GET', '/user/egoist')\n\nfor (const m of matches) {\n  m.handler(m.params)\n}\n// prints: 'egoist'\n```\n\n## Supported route pattern\n\nAll patterns that [Vue Router](https://next.router.vuejs.org/guide/essentials/route-matching-syntax.html) supports:\n\n- `/user/:user`: Parameter\n- `/:orderId(\\\\d+)`: Custom regexp\n- `/:chapters+`: Repeatable params\n- Consult the Vue Router docs for more..\n\n## License\n\nMIT \u0026copy; [EGOIST](https://github.com/sponsors/egoist)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Frouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Frouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Frouter/lists"}