Express-style Path to RegExp Utility

JSON →
library 8.4.2 ·javascript
verified May 27, 2026

path-to-regexp is a robust JavaScript/TypeScript utility for converting Express-style path strings, such as `/user/:name`, into regular expressions. It is widely used in routing libraries to match URLs against defined patterns, supporting features like named parameters (`:foo`), wildcards (`*splat`), and optional segments (`{/:id}`). The library also provides reverse functionality through its `compile` and `stringify` methods, allowing parameters to be transformed back into path strings. Currently at version `8.4.2`, it maintains an active development cadence with regular updates focusing on performance enhancements, bundle size reduction, and critical security fixes. Its primary differentiator is its comprehensive feature set for complex path matching and generation, making it a foundational component for many web frameworks and routers. It explicitly states its purpose for ordered data like paths, not arbitrary data like query strings. This package ships with TypeScript types.

total hits 20
actors 8 distinct systems
last hit 17h ago human
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
ChatGPT-User
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇨🇭 Switzerland · 🇳🇴 Norway