{"_id":"@chasket/chasket-router","_rev":"3-1b5ab0328ee515368063e21ccc7599bf","name":"@chasket/chasket-router","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@chasket/chasket-router","version":"0.2.0","keywords":["chasket","router","spa","web-components","client-side-routing","hash-routing","navigation-guards"],"author":{"name":"Aspect"},"license":"MIT","_id":"@chasket/chasket-router@0.2.0","maintainers":[{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"}],"homepage":"https://github.com/UltraEgoist/chasket#readme","bugs":{"url":"https://github.com/UltraEgoist/chasket/issues"},"dist":{"shasum":"b651d7c54c1f334f0bdeee8c5822ebc76d22d2d4","tarball":"https://registry.npmjs.org/@chasket/chasket-router/-/chasket-router-0.2.0.tgz","fileCount":5,"integrity":"sha512-+BKkLbRnh3o9oH7+aMqzt2IOeJJHGLiXN5PLWOqGzGEXkJMAz4vIITQB2dGC9n9FJo5tFTeanJorv2FFFQiV+Q==","signatures":[{"sig":"MEUCIQCoS8EfFAvBr7P+4/aACDLzsApzu3AQYmAMXn44xhF69wIgMt3dIg0iLFGlcLeAoyO6MvUtd9Vu4cck67N3PSina+s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33937},"main":"index.js","types":"index.d.ts","module":"index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"267a8699af8811a2d02b48c6d628ad579ef3ab20","scripts":{"test":"node --test test/router.test.js"},"_npmUser":{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"},"repository":{"url":"git+https://github.com/UltraEgoist/chasket.git","type":"git","directory":"chasket-router"},"_npmVersion":"11.5.2","description":"Client-side router for Chasket SPA applications with hash-based routing, navigation guards, and dynamic parameters","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"peerDependencies":{"@chasket/chasket":">=0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/chasket-router_0.2.0_1774709450843_0.8316035395497188","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@chasket/chasket-router","version":"0.2.1","keywords":["chasket","router","spa","web-components","client-side-routing","hash-routing","navigation-guards"],"author":{"name":"Aspect"},"license":"MIT","_id":"@chasket/chasket-router@0.2.1","maintainers":[{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"}],"homepage":"https://github.com/UltraEgoist/chasket#readme","bugs":{"url":"https://github.com/UltraEgoist/chasket/issues"},"dist":{"shasum":"60098bed57bac6da41d2bbd3f64876b22d0bd028","tarball":"https://registry.npmjs.org/@chasket/chasket-router/-/chasket-router-0.2.1.tgz","fileCount":5,"integrity":"sha512-kY4eoa4It9cJyBGNf1cdOErFfDtVlALW7Xhpbwk8UzkOXkzuY5p8X1FaG+OCyo3ZdMqe30tckkRu4eJkd8vDPw==","signatures":[{"sig":"MEUCICufy0WkHxoorxZ6u0R5e3oUrCW/Vx2c4aImw/0hGL+nAiEAjOiblrx8DwLlwwXipNbX90Uk3snAqV6NEfCMEQrIaTY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33937},"main":"index.js","types":"index.d.ts","module":"index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"5d7e62c16c56945ae0a8754a82690b0d0ac8d157","scripts":{"test":"node --test test/router.test.js"},"_npmUser":{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"},"repository":{"url":"git+https://github.com/UltraEgoist/chasket.git","type":"git","directory":"chasket-router"},"_npmVersion":"11.5.2","description":"Client-side router for Chasket SPA applications with hash-based routing, navigation guards, and dynamic parameters","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"peerDependencies":{"@chasket/chasket":">=0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/chasket-router_0.2.1_1774751543124_0.9875619385483252","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@chasket/chasket-router","version":"0.2.2","description":"Client-side router for Chasket SPA applications with hash-based routing, navigation guards, and dynamic parameters","main":"index.js","module":"index.mjs","types":"index.d.ts","exports":{".":{"import":"./index.mjs","require":"./index.js","types":"./index.d.ts"}},"sideEffects":false,"keywords":["chasket","router","spa","web-components","client-side-routing","hash-routing","navigation-guards"],"author":{"name":"Aspect"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/UltraEgoist/chasket.git","directory":"chasket-router"},"homepage":"https://github.com/UltraEgoist/chasket#readme","bugs":{"url":"https://github.com/UltraEgoist/chasket/issues"},"peerDependencies":{"@chasket/chasket":">=0.1.0"},"scripts":{"test":"node --test test/router.test.js"},"engines":{"node":">=18.0.0"},"_id":"@chasket/chasket-router@0.2.2","gitHead":"a445bbebec4054ef982a52b32efc8e9c2890c470","_nodeVersion":"24.14.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-3dt3cMPl+3bxU/DplAaNl/BDbILB/X7L4Semgy79bKzMuyAqUSud94IQuje1MiZF8OmP690OiopPqRW0Cn6T8Q==","shasum":"4354a848b598e0f0a55cef298be3f5cae9f81922","tarball":"https://registry.npmjs.org/@chasket/chasket-router/-/chasket-router-0.2.2.tgz","fileCount":5,"unpackedSize":33994,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAQXCwj6YTD1BPBArZ2cTUQuAPcu7H6wU/5jxTwh1306AiEA1NC1c2T5aJArGP/vhO/QESg8b/x1X2u3ngr4hRG1b6k="}]},"_npmUser":{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"},"directories":{},"maintainers":[{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chasket-router_0.2.2_1774796625226_0.35681191588460126"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-28T14:50:50.713Z","modified":"2026-03-29T15:03:45.827Z","0.2.0":"2026-03-28T14:50:50.991Z","0.2.1":"2026-03-29T02:32:23.285Z","0.2.2":"2026-03-29T15:03:45.389Z"},"bugs":{"url":"https://github.com/UltraEgoist/chasket/issues"},"author":{"name":"Aspect"},"license":"MIT","homepage":"https://github.com/UltraEgoist/chasket#readme","keywords":["chasket","router","spa","web-components","client-side-routing","hash-routing","navigation-guards"],"repository":{"type":"git","url":"git+https://github.com/UltraEgoist/chasket.git","directory":"chasket-router"},"description":"Client-side router for Chasket SPA applications with hash-based routing, navigation guards, and dynamic parameters","maintainers":[{"name":"umeko_ultraego","email":"harudaoo305@gmail.com"}],"readme":"# @chasket/chasket-router\n\n> Part of the [Chasket](https://chasket.dev) ecosystem.\n\nClient-side SPA router for Chasket applications. History API based routing with dynamic parameters, nested routes, guards, and Web Component integration.\n\nZero dependencies.\n\n## Installation\n\n```bash\nnpm install @chasket/chasket-router\n```\n\n## Quick Start\n\n```javascript\nimport { createRouter } from '@chasket/chasket-router';\n\nconst router = createRouter({\n  routes: [\n    { path: '/', component: 'x-home' },\n    { path: '/users/:id', component: 'x-user-detail' },\n    { path: '/about', component: 'x-about' },\n    { path: '*', component: 'x-not-found' },\n  ],\n});\n\ndocument.querySelector('chasket-router').router = router;\nrouter.start();\n```\n\n```html\n<chasket-router>\n  <chasket-link to=\"/\">Home</chasket-link>\n  <chasket-link to=\"/about\">About</chasket-link>\n  <chasket-route></chasket-route>\n</chasket-router>\n```\n\n## API\n\n### createRouter(options)\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `routes` | `RouteConfig[]` | `[]` | Route definitions |\n| `mode` | `'history' \\| 'hash'` | `'history'` | Routing mode |\n| `base` | `string` | `''` | Base path prefix |\n\n### RouteConfig\n\n```typescript\ninterface RouteConfig {\n  path: string;              // Route pattern (e.g. '/users/:id')\n  component: string;         // Custom element tag name\n  meta?: object;             // Arbitrary metadata\n  children?: RouteConfig[];  // Nested child routes\n}\n```\n\n### Router instance\n\n| Method | Description |\n|--------|-------------|\n| `start()` | Begin listening for navigation |\n| `push(path)` | Navigate to a path |\n| `replace(path)` | Replace current history entry |\n| `back()` | Go back in history |\n| `beforeEach(guard)` | Register a navigation guard |\n\n### Built-in elements\n\n| Element | Description |\n|---------|-------------|\n| `<chasket-router>` | Router container |\n| `<chasket-route>` | Route outlet (renders matched component) |\n| `<chasket-link>` | Navigation link (`to` attribute) |\n\n## Part of the Chasket ecosystem\n\nThis package is part of [Chasket](https://www.npmjs.com/package/@chasket/chasket), a template-first Web Component compiler.\n\n## License\n\n[MIT](../LICENSE)\n","readmeFilename":"README.md"}