normalize-path
npmv3.0.0Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.
Not recommended for new projects
No — normalize-path should not be adopted for new projects. Last published 3065 days ago.
- AAdoption: grade A, Excellent.
72.6M downloads per week and 1 known dependents.
- FMaintenance: grade F, Failing.
Last published 3065 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 9.0 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 3 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding normalize-path to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >=0.10.0
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the normalize-path README.
const normalize = require('normalize-path');
console.log(normalize('\\foo\\bar\\baz\\'));
//=> '/foo/bar/baz'normalize-path vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| normalize-paththis page | 72.6M | 1 | MIT | 8 years ago |
| slash | 0 | 14 | MIT | 1 day ago |
| split-on-first | 9.7M | 1 | MIT | 1 day ago |
| path-parse | 0 | 1 | MIT | 1 day ago |
| anymatch | 0 | 1 | ISC | 1 day ago |
| make-dir | 0 | 2 | MIT | 1 day ago |
Dependencies
Declared by normalize-path v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (3)
Used by
Popular packages that depend on normalize-path.
Relationship graph
Dependencies (left) and dependents (right) of normalize-path.
Frequently installed together
Release history
No releases in the last two years, typically about 92 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.0latest | 8 years ago | 9.0 KB | MIT |
| 2.1.1 | 9 years ago | — | MIT |
| 2.1.0 | 9 years ago | — | MIT |
| 2.0.1 | 10 years ago | — | MIT |
| 2.0.0 | 11 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
| 0.3.0 | 12 years ago | — | MIT |
| 0.2.1 | 12 years ago | — | MIT |
| 0.2.0 | 12 years ago | — | MIT |
| 0.1.1 | 12 years ago | — | MIT |
| 0.1.0 | 12 years ago | — | MIT |
Overview
normalize-path is an npm package that normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled. It is extremely widely used, with about 72.6M downloads per week and 1 known dependents in the graph. The latest version is 3.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (72.6M weekly downloads).
- Clear open-source license (MIT).
- Lean dependency tree (3 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use normalize-path?
No — normalize-path should not be adopted for new projects. Last published 3065 days ago.
How do I install normalize-path?
Run `npm install normalize-path` to add normalize-path to your npm project.
What license is normalize-path released under?
normalize-path is distributed under the MIT license.
How popular is normalize-path?
normalize-path has approximately 72,619,557 downloads per week and 1 known dependent packages.
Is normalize-path still maintained?
The most recent release of normalize-path (v3.0.0) was published 8 years ago.
Does normalize-path run install scripts?
No. normalize-path does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.