rou3 is a lightweight and fast JavaScript router, currently at version 0.8.1. It provides efficient routing capabilities for various JavaScript environments including Node.js, Bun, Deno, and browsers. The library is actively maintained with frequent minor releases and bug fixes, often including performance enhancements and type improvements, as seen in recent versions like 0.8.0 and 0.7.12. Key differentiators include its URLPattern-compatible syntax for defining routes, support for complex patterns like named wildcards, optional parameters, and custom regex, as well as features for escaping special characters in paths. It ships with TypeScript types, ensuring a robust developer experience for typed applications.
npm install rou3Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a router, adding various route patterns including parameters and wildcards, and then using `findRoute` to match incoming requests and extract associated data and parameters.
Review your route patterns against the new URLPattern-compatible syntax documentation. Test all existing routes thoroughly after upgrading.
Always prepend a '/' to your route paths, e.g., `/users` instead of `users`.
Ensure all HTTP methods are uppercase, e.g., 'GET', 'POST', 'PUT', 'DELETE'.
For literal characters, use `\:` for a colon and `\*` for an asterisk. For example, `/static\:path/`.
Ensure you are using `import { addRoute } from 'rou3';` in an ESM environment, or configure your bundler (like Webpack/Rollup/esbuild) to correctly handle ESM modules in a CommonJS project.Verify that all paths start with `/` and all methods are uppercase. Check your route patterns against the URLPattern compatibility documentation, particularly for complex regex or wildcard usage.
No dependency data recorded yet.