{"_id":"@zoontek/chicane","name":"@zoontek/chicane","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@zoontek/chicane","version":"3.0.0","license":"MIT","packageManager":"pnpm@10.24.0","description":"A simple and safe router for React and TypeScript","author":{"name":"Mathieu Acthernoene","email":"zoontek@gmail.com"},"homepage":"https://zoontek.github.io/chicane","repository":{"type":"git","url":"git+https://github.com/zoontek/chicane.git"},"zshy":{"exports":{".":"./src/index.ts","./server":"./src/server.ts"}},"types":"./dist/index.d.ts","module":"./dist/index.mjs","main":"./dist/index.js","source":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.mjs","require":"./dist/server.js"}},"keywords":["hook","react","router","typescript"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"clean":"rm -rf dist","format":"prettier '**/*' --ignore-unknown --write","lint":"eslint","test":"vitest --run","test:watch":"vitest --watch","typecheck":"tsc --noEmit","build":"pnpm clean && zshy && rm -rf dist/*.d.mts","prepack":"pnpm typecheck && pnpm lint && pnpm test && pnpm build"},"prettier":{"plugins":["prettier-plugin-organize-imports"]},"peerDependencies":{"react":">=19.0.0"},"dependencies":{"@emotion/hash":"^0.9.2","use-sync-external-store":"^1.6.0"},"devDependencies":{"@eslint/js":"^9.39.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.0","@types/node":"^20.19.25","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","@types/use-sync-external-store":"^1.5.0","eslint":"^9.39.1","eslint-plugin-react-hooks":"^7.0.1","jsdom":"^27.2.0","prettier":"^3.7.3","prettier-plugin-organize-imports":"^4.3.0","react":"^19.2.0","react-dom":"^19.2.0","typescript":"^5.9.3","typescript-eslint":"^8.48.0","vitest":"^4.0.14","zshy":"^0.6.0"},"gitHead":"7798edc0cd108d054ae9f1c26769167f1b035304","_id":"@zoontek/chicane@3.0.0","bugs":{"url":"https://github.com/zoontek/chicane/issues"},"_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-tOyjQRPvmX/FNaZ4WxyGvNhnUxNSmlqUroqypFtMXI1JnX1KcTnRc2YmWgUiQtfMIYkkzU7Un+GBobLv6+K34w==","shasum":"42f9569f3c4742a7f92a171fe5bad8ad8632bb44","tarball":"https://registry.npmjs.org/@zoontek/chicane/-/chicane-3.0.0.tgz","fileCount":73,"unpackedSize":145383,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHSIcMlcTsb6flqQuZdYS2RO+oNX6vFNIOBFj1tCGsz/AiEAvzEuCNv2fBjEpgFg7L9S6miaEfHUIDnL4AfUBuSXRdA="}]},"_npmUser":{"name":"zoontek","email":"zoontek@gmail.com"},"directories":{},"maintainers":[{"name":"zoontek","email":"zoontek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chicane_3.0.0_1776677579116_0.7839122033555299"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-20T09:32:59.016Z","3.0.0":"2026-04-20T09:32:59.280Z","modified":"2026-04-20T09:32:59.498Z"},"maintainers":[{"name":"zoontek","email":"zoontek@gmail.com"}],"description":"A simple and safe router for React and TypeScript","homepage":"https://zoontek.github.io/chicane","keywords":["hook","react","router","typescript"],"repository":{"type":"git","url":"git+https://github.com/zoontek/chicane.git"},"author":{"name":"Mathieu Acthernoene","email":"zoontek@gmail.com"},"bugs":{"url":"https://github.com/zoontek/chicane/issues"},"license":"MIT","readme":"<img width=\"108\" alt=\"@zoontek/chicane logo\" src=\"https://github.com/zoontek/chicane/blob/main/docs/static/img/logo.svg?raw=true\">\n\n# @zoontek/chicane\n\n[![mit licence](https://img.shields.io/dub/l/vibe-d.svg?style=for-the-badge)](https://github.com/zoontek/chicane/blob/main/LICENSE)\n[![npm version](https://img.shields.io/npm/v/@zoontek/chicane?style=for-the-badge)](https://www.npmjs.org/package/@zoontek/chicane)\n[![bundlephobia](https://img.shields.io/bundlephobia/minzip/@zoontek/chicane?label=size&style=for-the-badge)](https://bundlephobia.com/result?p=@zoontek/chicane)\n\nA simple and safe router for React and TypeScript.\n\n## Design principles\n\n- **Typed routes**: improving the DX, and making sure all your params are here!\n- **Component-friendly**: the router nicely fits in your React app.\n- **Easy-to-use**: naming routes instead of moving around unsafe URLs.\n- **Performant**: avoids any unnecessary render.\n\n## Installation\n\n```bash\n$ yarn add @zoontek/chicane\n# --- or ---\n$ npm install --save @zoontek/chicane\n```\n\n## Links\n\n- 📘 [**Documentation**](https://zoontek.github.io/chicane)\n- ⚖️ [**License**](./LICENSE)\n\n## Quickstart\n\n```tsx\nimport { createRouter } from \"@zoontek/chicane\";\nimport { match } from \"ts-pattern\";\n\nconst Router = createRouter({\n  Home: \"/\",\n  Users: \"/users\",\n  User: \"/users/:userId\",\n});\n\nconst App = () => {\n  const route = Router.useRoute([\"Home\", \"Users\", \"User\"]);\n\n  // route object is a discriminated union\n  return match(route)\n    .with({ name: \"Home\" }, () => <h1>Home</h1>)\n    .with({ name: \"Users\" }, () => <h1>Users</h1>)\n    .with({ name: \"User\" }, ({ params }) => <h1>User {params.userId}</h1>) // params are strongly typed\n    .otherwise(() => <h1>404</h1>);\n};\n```\n\n## Run the example app\n\n```bash\n$ git clone git@github.com:zoontek/chicane.git\n$ cd chicane/example\n\n$ yarn install && yarn dev\n# --- or ---\n$ npm install && npm run dev\n```\n\n## 🙌 Acknowledgements\n\n- [react-router](https://github.com/remix-run/react-router) for the `history` and the `Link` creation code.\n- [reach-router](https://github.com/reach/router) for the path ranking algorithm.\n","readmeFilename":"README.md","_rev":"1-87b12f0a703708a57bebafd85e451a05"}