</>PackageGraphPackageGraph

normalize-path

npmv3.0.0

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.

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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

9.0 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

PackageWeekly downloadsDependentsLicenseLast release
normalize-paththis page72.6M1MIT8 years ago
slash014MIT1 day ago
split-on-first9.7M1MIT1 day ago
path-parse01MIT1 day ago
anymatch01ISC1 day ago
make-dir02MIT1 day ago

Dependencies

Declared by normalize-path v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (3)

gulp-format-md ^1.0.0minimist ^1.2.0mocha ^3.5.3

Used by

Popular packages that depend on normalize-path.

Relationship graph

Dependencies (left) and dependents (right) of normalize-path.

anymatchnormalize-path
normalize-path dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 92 days apart.

Recent versions of normalize-path
VersionPublishedSizeLicense
3.0.0latest8 years ago9.0 KBMIT
2.1.19 years agoMIT
2.1.09 years agoMIT
2.0.110 years agoMIT
2.0.011 years agoMIT
1.0.011 years agoMIT
0.3.012 years agoMIT
0.2.112 years agoMIT
0.2.012 years agoMIT
0.1.112 years agoMIT
0.1.012 years agoMIT

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

Keywords

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.