Gathering detailed insights and metrics for @flex-development/pathe
Gathering detailed insights and metrics for @flex-development/pathe
Gathering detailed insights and metrics for @flex-development/pathe
Gathering detailed insights and metrics for @flex-development/pathe
npm install @flex-development/pathe
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
408 Commits
2 Watching
6 Branches
2 Contributors
Updated on 27 Nov 2024
TypeScript (82.43%)
JavaScript (17.03%)
Shell (0.37%)
Ruby (0.17%)
Cumulative downloads
Total Downloads
Last day
-66.7%
1
Compared to previous day
Last week
-75%
8
Compared to previous week
Last month
-30.1%
225
Compared to previous month
Last year
22.7%
1,303
Compared to previous year
133
Universal drop-in replacement for node:path
This package is a universal drop-in replacement for Node.js' path
module.
It enforces consistency between POSIX and Windows operating systems and also provides additional utilities for working with file URLs, paths, and extensions.
For historical reasons, Windows followed MS-DOS and used backslashes (\
) to separate path
components, as opposed to the forwardslashes (/
) used by POSIX operating systems. Even though Windows operating
systems now support both separators, there are still discrepancies between operating systems when using Node.js' path
module:
The default operation of the
node:path
module varies based on the operating system on which a Node.js application is running. Specifically, when running on a Windows operating system, thenode:path
module will assume that Windows-style paths are being used. – Windows vs. POSIX
This package enforces consistency between operating systems by ensuring paths are POSIX-compliant. With support for both
drive and UNC paths as well, platform-specific modules like
node:path/posix
and node:path/win32
are no longer needed.
To achieve consistent results when working with Windows file paths on any operating system, usepath.win32
.To achieve consistent results when working with POSIX file paths on any operating system, usepath.posix
.
To achieve consistent results when working with Windows file paths on any operating system, use pathe
. To achieve
consistent results when working with POSIX file paths on any operating system, use pathe
. :blush:
This package is ESM only.
In Node.js (version 18+) with yarn:
1yarn add @flex-development/pathe
See Git - Protocols | Yarn for details regarding installing from Git.
In Deno with esm.sh
:
1import { parse } from 'https://esm.sh/@flex-development/pathe'
In browsers with esm.sh
:
1<script type="module"> 2 import { parse } from 'https://esm.sh/@flex-development/pathe' 3</script>
1import { 2 addExt, 3 basename, 4 changeExt, 5 cwd, 6 delimiter, 7 dirname, 8 dot, 9 extToValue, 10 extname, 11 fileURLToPath, 12 format, 13 formatExt, 14 isAbsolute, 15 isDeviceRoot, 16 isSep, 17 isURL, 18 join, 19 matchesGlob, 20 normalize, 21 parse, 22 pathToFileURL, 23 relative, 24 removeExt, 25 resolve, 26 resolveWith, 27 root, 28 sep, 29 toNamespacedPath, 30 toPath, 31 toPosix 32} from '@flex-development/pathe'
This package exports the following identifiers:
addExt
basename
changeExt
cwd
delimiter
dirname
dot
extToValue
extname
extnames
fileURLToPath
formatExt
format
isAbsolute
isDeviceRoot
isSep
isURL
join
matchesGlob
normalize
parse
pathToFileURL
posix
relative
removeExt
resolveWith
resolve
root
sep
toNamespacedPath
toPath
toPosix
win32
The default export is pathe
.
Documentation website coming soon.
This package is fully typed with TypeScript.
Cwd
Delimiter
DeviceRoot
Dot
DriveLetter
EmptyString
Ext
FormatInputPathObject
ParsedPath
Pathe
PlatformOptions
PlatformPath
PosixDelimiter
PosixPlatformPath
PosixSep
Sep
WindowsDelimiter
WindowsPlatformPath
WindowsSep
See CONTRIBUTING.md
.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
No vulnerabilities found.
No security vulnerabilities found.