Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 16, 2024 via pnpm

normalize-path 3.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.
Package summary
Share
0
issues
1
license
1
MIT
Package created
26 Jun 2014
Version published
19 Apr 2018
Maintainers
3
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
normalize-path@3.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of normalize-path 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does normalize-path do?

Normalize-path is a highly useful npm package designed to normalize slashes in a file path, converting them into POSIX or Unix-like forward slashes. It is an effective tool for decluttering file paths, as it condenses repeat slashes into a single slash and eliminates trailing slashes, unless this functionality is intentionally disabled. This utility can help provide streamlined, consistent file paths, resulting in improved readability and manageability of your JavaScript codebase.

How do you use normalize-path?

Using normalize-path in your JavaScript applications is straightforward. After installing it using npm with the command npm install --save normalize-path, it can be included into your project using the require statement. Below are some examples illustrating how to use this package:

const normalize = require('normalize-path');

console.log(normalize('\\foo\\bar\\baz\\')); 
// Outputs: '/foo/bar/baz'

Windows 32 namespaces, consecutive slashes, and trailing slashes are also handled smartly by this module. For instance, to prevent removal of trailing slashes, pass false as the last argument.

console.log(normalize('foo\\bar\\baz\\', false)); // Outputs: 'foo/bar/baz/'

Multiple consecutive forward slashes are condensed into a single slash, optimizing the cleanliness of your paths.

Where are the normalize-path docs?

The best place to find comprehensive documentation for normalize-path is on its GitHub repository (https://github.com/jonschlinkert/normalize-path). You'll find extensive information about the module's functionality, as well as usage examples and installation guidance. You can also explore the Release History section for updates and changes made throughout its versions and look into the contributing guidelines if you're interested in contributing to the development of this project.