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 Apr 14, 2024 via pnpm

path-parse 1.0.7

Node.js path.parse() ponyfill
Package summary
Share
0
issues
1
license
1
MIT
Package created
17 Apr 2015
Version published
25 May 2021
Maintainers
1
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:
path-parse@1.0.7
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 path-parse 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does path-parse do?

Path-parse is a popular npm package that serves as a ponyfill for Node.js's path.parse(pathString) function. Its main function is to silently improve or enhance intrinsic JavaScript functionalities without tampering with the native API. It parses a path string into constituent components and returns an object with properties such as root, dir (directory), base (base name), ext (extension), and name (file name).

How do you use path-parse?

To use path-parse, you first need to install it using npm. By running the command npm install --save path-parse in your terminal, you can easily add it to your project. Once installed, you can require it in your JS file and use it to parse a filepath string into its components. Here's a snippet of code that demonstrates its usage:

var pathParse = require('path-parse');

var parsedPath = pathParse('/home/user/dir/file.txt');
console.log(parsedPath);
// Output: {
//       root : "/",
//       dir : "/home/user/dir",
//       base : "file.txt",
//       ext : ".txt",
//       name : "file"
//   }

In the example above, a string representing a filepath is passed into the pathParse function, and an object containing the filepath's root, dir, base, ext, and name properties is returned.

Path-parse also includes posix (for *nix-based systems) and win32 (for Windows-based systems) specific versions for path parsing. These can be accessed as such: pathParse.posix(path) and pathParse.win32(path).

Where are the path-parse docs?

As for the path-parse documentation, it redirects users to the official Node.js path.parse() documentation. Because path-parse is a ponyfill for this Node.js function, the information available in Node.js's official documentation is relevant and applicable. Additionally, further details about the path-parse package can be found in its GitHub repository.