Socket
Socket
Sign inDemoInstall

path-parse

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-parse

Node.js path.parse() ponyfill


Version published
Weekly downloads
42M
decreased by-0.65%
Maintainers
1
Weekly downloads
 
Created

What is path-parse?

The path-parse npm package is a utility for parsing a file path into its segments, offering a consistent and reliable way to dissect a path's components such as the root, directory, base, extension, and name. It is particularly useful in environments where path manipulation is necessary but challenging due to varying file system conventions.

What are path-parse's main functionalities?

Parsing file paths

This feature allows you to parse a full file path into an object containing properties such as root, dir, base, ext, and name. The code sample demonstrates parsing a Unix file path, which results in an object detailing each component of the path.

const pathParse = require('path-parse');
const parsedPath = pathParse('/home/user/dir/file.txt');
console.log(parsedPath);

Other packages similar to path-parse

Keywords

FAQs

Package last updated on 17 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc