next-url-rewrite
TypeScript library for rule-based URL rewriting in Next.js middleware, with a framework-agnostic core and a fluent builder API.
- Two npm packages: @next-url-rewrite/core (matching engine) and @next-url-rewrite/next (middleware integration)
- Segment matching with wildcards, allowed-value constraints, and segment stripping, without regular expressions
- 52 Vitest tests (31 core, 21 Next.js); validateRules() returns rule errors and warnings, and loadConfig() runs it by default
