Enhance your preferred routing library by incorporating powerful path generation including:
- Path & template rendering
- Nested, absolute, and relative paths
- Parameter parsing and serialization
- Type-safe, customizable, and extendable
- Also useful with JavaScript
The complete documentation can be found here.
- Methods
render
: renders a path with parameterstemplate
: renders a route templateparseParams
: parses dynamic segments in a pathparseQuery
: parses parameters in a search query
- Chainable operators:
bind
: binds parameters to a route for later renderingfrom
: creates a new route based on a string-based path (i.e.location.path
)replace
: replaces segments in a path
Version 11 is currently under development. Please don't use it in production yet. The official release will happen soon. The v10 documentation can be found here.
npm i typesafe-routes@next # or any npm alternatives
- leave a star ⭐
- report a bug 🐞
- open a pull request 🏗️
- help others ❤️
- buy me a coffee ☕
- v11 migration guide
- check for duplicate param names in the route tree
- context caching
- customizable parsing of search params
- demos & utils
- react-router
- refinejs
- vue router
- angular router