Spices up your favorite routing library by adding type safety to plain string-based route definitions.
Enhance your preferred routing library by incorporating powerful path generation including:
The complete documentation can be found here.
render
: renders a path with parameterstemplate
: renders a route templateparseParams
: parses dynamic segments in a pathparseQuery
: parses parameters in a search querybind
: 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 pathVersion 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