Skip to content

Commit 3493b05

Browse files
committed
chore: update readme
1 parent 9158288 commit 3493b05

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

README.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
[![size][size-src]][size-href]
88

99
> **❓ Why**
10-
>
11-
> For [historical reasons](https://docs.microsoft.com/en-us/archive/blogs/larryosterman/why-is-the-dos-path-character), windows followed MS-DOS and using backslash for separating paths rather than slash used for macOS, Linux, and other Posix operating systems. Nowadays, [Windows](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN) supports both Slash and Backslash for paths. [Node.js's built in `path` module](https://nodejs.org/api/path.html) 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.**
10+
11+
For [historical reasons](https://docs.microsoft.com/en-us/archive/blogs/larryosterman/why-is-the-dos-path-character), windows followed MS-DOS and using backslash for separating paths rather than slash used for macOS, Linux, and other Posix operating systems. Nowadays, [Windows](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN) supports both Slash and Backslash for paths. [Node.js's built in `path` module](https://nodejs.org/api/path.html) 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.**
12+
1213
> Compared to popular [upath](https://github.com/anodynos/upath), pathe is providing **identical exports** of Node.js with normalization on **all operations** and written in modern **ESM/TypeScript** and has **no dependency on Node.js**!
1314
1415
This package is a drop-in replacement of the Node.js's [path module](https://nodejs.org/api/path.html) module and ensures paths are normalized with slash `/` and work in environments including Node.js.
@@ -32,38 +33,41 @@ Import:
3233

3334
```js
3435
// ESM / Typescript
35-
import { resolve } from 'pathe'
36+
import { resolve, matchesGlob } from "pathe";
3637

3738
// CommonJS
38-
const { resolve } = require('pathe')
39+
const { resolve, matchesGlob } = require("pathe");
3940
```
4041

41-
Read more about path utils from [Node.js documentation](https://nodejs.org/api/path.html) and rest assured behavior is ALWAYS like POSIX regardless of your input paths format and running platform!
42+
Read more about path utils from [Node.js documentation](https://nodejs.org/api/path.html) and rest assured behavior is consistently like POSIX regardless of your input paths format and running platform (only exception is `delimiter` constant export, it will be set to `;` on windows platform).
4243

4344
### Extra utilities
4445

4546
Pathe exports some extra utilities that do not exist in standard Node.js [path module](https://nodejs.org/api/path.html).
4647
In order to use them, you can import from `pathe/utils` subpath:
4748

4849
```js
49-
import { filename, normalizeAliases, resolveAlias, reverseResolveAlias } from 'pathe/utils'
50+
import {
51+
filename,
52+
normalizeAliases,
53+
resolveAlias,
54+
reverseResolveAlias,
55+
} from "pathe/utils";
5056
```
5157

5258
## License
5359

54-
MIT. Made with 💖
60+
Made with 💛 Published under the [MIT](./LICENSE) license.
5561

56-
Some code used from Node.js project. See [LICENSE](./LICENSE).
62+
Some code used from Node.js project. Glob supported is powered by [zeptomatch](https://github.com/fabiospampinato/zeptomatch).
5763

5864
<!-- Refs -->
65+
5966
[npm-v-src]: https://img.shields.io/npm/v/pathe?style=flat-square
6067
[npm-v-href]: https://npmjs.com/package/pathe
61-
6268
[npm-d-src]: https://img.shields.io/npm/dm/pathe?style=flat-square
6369
[npm-d-href]: https://npmjs.com/package/pathe
64-
6570
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/pathe/ci/main?style=flat-square
6671
[github-actions-href]: https://github.com/unjs/pathe/actions?query=workflow%3Aci
67-
6872
[size-src]: https://packagephobia.now.sh/badge?p=pathe
6973
[size-href]: https://packagephobia.now.sh/result?p=pathe

0 commit comments

Comments
 (0)