normalize-url
10.0.0 · 14 Oct 2026MIT62.8M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgradeLatest releases
All 58 releases- 10.x · latest line
10.0.0
14 Oct 2026- Breaking
Require Node.js 22 6c95de2
- Breaking
Throw a
TypeErrorwhen thedefaultProtocoloption is not a valid scheme, such as'https://'a8c34ae - Breaking
The query is now always re-serialized, even with
sortQueryParameters: false65f62ef
Breaking
- Breaking
Require Node.js 22 6c95de2
- Breaking
Throw a
TypeErrorwhen thedefaultProtocoloption is not a valid scheme, such as'https://'a8c34ae - Breaking
The query is now always re-serialized, even with
sortQueryParameters: false65f62efPreviously, disabling sorting kept the query exactly as written. Now it is written the way
URLSearchParamswrites it, so%20becomes+and an escape that is not valid UTF-8, like%E9, becomes%EF%BF%BD.
- Breaking
The
removeDirectoryIndexoption now runs aftertransformPath, so the function also receives the index file 65f62ef - Breaking
Many edge cases are now normalized differently (see below). If you store normalized URLs, you may want to normalize them again.
Improvements
The
defaultProtocoloption now accepts any protocol, not justhttpandhttpsb2e4135Strip all whitespace from the ends of a URL, including a non-breaking space and a byte order mark left over from copying 13f62a4
Keep repeated query keys in their original order when sorting 5a3e67a
Normalizing an already normalized URL now always gives the same URL
Document the normalizations that happen regardless of the options bb685bc
Fixes
Fix normalization of the protocol, host, port, path, query, fragment, and data URLs 65f62ef
http:/example.comno longer becomeshttp://http/example.com%252Fin a path no longer becomes%2F, which is a different URLA trailing
/in the query is no longer removednormalizeProtocol: falsenow keeps a protocol-relative URL, even withdefaultProtocol: 'https'A data URL without a comma no longer throws
Fix several data URL cases where the normalized URL was decoded differently by browsers 5d8ff58 cf2aed8 bd39d02
- 9.x · maintenance
9.0.0
19 Feb 2026- Breaking
Require Node.js 20 c0477f6
Add
customProtocolsoption 0c6c6b9Add
emptyQueryValueoption 2f2536e
Breaking
- Breaking
Require Node.js 20 c0477f6
Improvements
Add
customProtocolsoption 0c6c6b9Add
emptyQueryValueoption 2f2536ePreserve percent-encoded reserved query characters 5630770
Dependency tracking
Know when your own dependencies move
normalize-url shipped 2 new majors in the last 12 months, among 4 releases. inlinr shows which of your projects are behind, and what the upgrade breaks.
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.
Reading releases, release notes and advisories…
Registry facts last checked 20 Nov 2026. Releases and advisories last read 20 Nov 2026.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.