path-to-regexp
9.0.0 · 22 Oct 2026MIT312.8M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgradeLatest releases
All 74 releases- 9.x · latest line
9.0.0
22 Oct 2026Avoid duplicate trailing delimiter matches
Refactor matching to be non-greedy
Build project as ESM
Important: This release switches the package to ESM only and node >= 22. The primary incompatible API change is to switch ambiguous matches (2+ parameters in a segment) from the first being greedy to the last. For example:
const input = "/foo.json.html"; const fn = match("/:file.:ext"); fn(input); //=> ["foo", "json.html"]In the v8 this would have output
["foo.json", "html"]. Making the last parameter and wildcard greedy can improve performance of the regular expressions and makes it easier to build non-regex based versions of the matcher.Changed
Avoid duplicate trailing delimiter matches
A path that explicitly provided the trailing delimiter (e.g.
/foo/) will no longer append an extra optional delimiter
Refactor matching to be non-greedy
Build project as ESM
Remove
TokenDataclass andKeystype
Fixed
Reject an empty-string param in compile
Reject wildcard array that compiles to an empty path
Fix stringify of param names with control characters
Quote param names followed by astral ID_Continue text
Fix stringify lookahead across empty text tokens
- 8.x · maintenance
8.4.1
30 Mar 2026Fixed
Remove trie deduplication (#431) 6bc8e84
Using a trie required non-greedy matching, which regressed wildcards in non-ending mode by matching them up until the first match. For example:
/*foowith/a/b=/a/*foo.htmlwith/a/b.html/c.html=/a/b.html
Allow backtrack handling to match itself (#427) 5bcd30b
When backtracking was introduced, it rejected matching things like
/:"a"_:"b"against/foo__. This makes intuitive sense because the second parameter is not going to backtrack on_anymore, but it's somewhat unexpected since there's no reason it shouldn't match the second_.
Dependency tracking · free for 3 projects
Know when your own dependencies move
path-to-regexp had 3 security advisories in the last 12 months. inlinr emails you the day one touches a project of yours, with the version that fixes it.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 12 Nov 2026. Releases and advisories last read 12 Nov 2026.