1. path-parse
Node.js path.parse() ponyfill
path-parse
Package: path-parse
Created by: jbgutierrez
Last modified: Thu, 23 Jun 2022 14:38:12 GMT
Version: 1.0.7
License: MIT
Downloads: 166,387,807
Repository: https://github.com/jbgutierrez/path-parse

Install

npm install path-parse
yarn add path-parse

path-parse Build Status

Node.js path.parse(pathString) ponyfill.

Install

$ npm install --save path-parse

Usage

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

pathParse('/home/user/dir/file.txt');
//=> {
//       root : "/",
//       dir : "/home/user/dir",
//       base : "file.txt",
//       ext : ".txt",
//       name : "file"
//   }

API

See path.parse(pathString) docs.

pathParse(path)

pathParse.posix(path)

The Posix specific version.

pathParse.win32(path)

The Windows specific version.

License

MIT © Javier Blanco

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code