Time slots app prototype
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Marek Piasecki 06fbe82dce npx imba create (Vite) 2 years ago
..
dist npx imba create (Vite) 2 years ago
CHANGELOG.md npx imba create (Vite) 2 years ago
LICENSE npx imba create (Vite) 2 years ago
README.md npx imba create (Vite) 2 years ago
package.json npx imba create (Vite) 2 years ago

README.md

pathe

Normalized paths for Node.js

version downloads size

🧪 This package is still experimental and might not handle all cases. Please track issues.

Why

For historical reasons, windows followed MS-DOS and using backslash for separating paths rather than slash used for macOS, Linux, and other Posix operating systems. Nowadays, Windows supports both Slash and Backslash for paths.

Node.js's built in path module in the default operation of the path module varies based on the operating system on which a Node.js application is running. Specifically, when running on a Windows operating system, the path module will assume that Windows-style paths are being used. This makes inconsistent code behavior between Windows and POSIX.

This package is a drop-in replacement of the Node.js's path module and ensures paths are normalized with slash /.

Compared to popular upath, pathe is providing identical exports of Node.js with normalization on all operations and written in modern ESM/Typescript.

💿 Install

Install using npm or yarn:

npm i pathe
# or
yarn add pathe

Import:

// ESM / Typescript
import { resolve } from 'pathe'

// CommonJS
const { resolve } = require('pathe')

Read more about path utils from Node.js documentation and rest assured behavior is ALWAYS like POSIX regardless of your input paths format and running platform!

License

MIT. Made with 💖

Some code used form Node.js project. See LICENSE.