path-to-regexp
9.0.0 · 22 Oct 2026MIT310.6M / weekRepositoryHomepagenpmAtom feed
74 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 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
8.4.2
1 Apr 2026Reading the note…
8.4.1
30 Mar 2026Reading the note…
8.4.0
26 Mar 2026Reading the note…
8.3.0
2 Sep 2025Reading the note…
8.2.0
26 Sep 2024Reading the note…
8.1.0
10 Sep 2024Reading the note…
8.0.0
1 Sep 2024Reading the note…
- 7.x
7.2.0
10 Sep 2024Reading the note…
7.1.0
13 Jul 2024Reading the note…
7.0.0
20 Jun 2024Reading the note…
- 6.x
6.3.0
12 Sep 2024Reading the note…
6.2.2
7 Apr 2024Reading the note…
6.2.1
6 May 2022Reading the note…
6.2.0
29 Sep 2020Reading the note…
6.1.0
20 Nov 2019Reading the note…
6.0.0
20 Nov 2019Reading the note…
- 5.x
5.0.0
12 Nov 2019Reading the note…
- 4.x
4.0.5
12 Nov 2019Reading the note…
4.0.4
12 Nov 2019Reading the note…
4.0.3
12 Nov 2019Reading the note…
4.0.2
12 Nov 2019Reading the note…
4.0.1
12 Nov 2019Reading the note…
4.0.0
12 Nov 2019Reading the note…
- 3.x
3.3.0
10 Sep 2024Reading the note…
3.2.0
11 Nov 2019Reading the note…
3.1.0
31 Aug 2019Reading the note…
3.0.0
14 Jan 2019Reading the note…
- 2.x
2.4.0
26 Aug 2018Reading the note…
2.3.0
20 Aug 2018Reading the note…
2.2.1
24 Apr 2018Reading the note…
2.2.0
7 Mar 2018Reading the note…
2.1.0
20 Oct 2017Reading the note…
2.0.0
23 Aug 2017Reading the note…
- 1.x
1.9.0
10 Sep 2024Reading the note…
1.8.0
11 Nov 2019Reading the note…
1.7.0
8 Nov 2016Reading the note…
1.6.0
3 Oct 2016Reading the note…
1.5.3
16 Jun 2016Reading the note…
1.5.2
16 Jun 2016Reading the note…
1.5.1
8 Jun 2016Reading the note…
1.5.0
20 May 2016Reading the note…
1.4.0
19 May 2016Reading the note…
1.3.0
8 May 2016Reading the note…
1.2.1
17 Aug 2015Reading the note…
1.2.0
21 May 2015Reading the note…
1.1.1
12 May 2015Reading the note…
1.1.0
9 May 2015Reading the note…
1.0.3
17 Jan 2015Reading the note…
1.0.2
17 Dec 2014Reading the note…