Radix3 is a lightweight and high-performance routing library for JavaScript and TypeScript, currently stable at version 1.1.2. It implements a Radix Tree data structure to offer efficient route matching, making it particularly well-suited for server-side applications, API gateways, and edge runtimes where request routing speed is critical. The library maintains an active development cadence, with regular minor releases introducing enhancements and performance improvements, as seen in the recent updates to v0.8.x and v1.x. Its key differentiators include its minimal footprint, speed, and robust support for various route patterns like named parameters, wildcards, and regex-like segments. It also provides utilities for exporting and rehydrating route matchers, enabling pre-compiled routing logic for faster startup times. Radix3 ships with full TypeScript type definitions, ensuring a strong developer experience.
npm install radix3Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a Radix3 router, inserting various route patterns (static, named, wildcard), performing lookups, and utilizing the `toRouteMatcher` and `exportMatcher` utilities for advanced matching and persistence.
Consult the `radix3` documentation on 'Route Patterns' to understand the updated compatibility rules and adjust your route definitions as necessary.
Rename any `params` key within your route's `data` object to avoid conflicts, e.g., `payload.params` or `customParams`.
Initialize the router with `createRouter({ strictTrailingSlash: true })` to enable strict trailing slash behavior.Use `\:` to match a literal colon and `\*` to match a literal asterisk in your route definition paths.
Ensure your import statement matches your module system. For ESM, use `import { createRouter } from 'radix3';`. For CommonJS, use `const { createRouter } = require('radix3');`.Ensure the router is initialized with `{ strictTrailingSlash: true }` when `createRouter()` is called, and that you are using this specific router instance for lookups.If these characters are part of a literal path segment and not intended as route patterns, they must be escaped using a backslash, e.g., `/api\:version` or `/files\*`.
No dependency data recorded yet.