CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
README.md74 linesDownload Raw Back to pathe
1# ๐Ÿ›ฃ๏ธ pathe2 3> Universal filesystem path utils4 5[![version][npm-v-src]][npm-v-href]6[![downloads][npm-d-src]][npm-d-href]7[![size][size-src]][size-href]8 9## โ“ Why10 11For [historical reasons](https://docs.microsoft.com/en-us/archive/blogs/larryosterman/why-is-the-dos-path-character), windows followed MS-DOS and used 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 13Compared to popular [upath](https://github.com/anodynos/upath), pathe provides **identical exports** of Node.js with normalization on **all operations** and is written in modern **ESM/TypeScript** and has **no dependency on Node.js**!14 15This 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.16 17## ๐Ÿ’ฟ Usage18 19Install using npm or yarn:20 21```bash22# npm23npm i pathe24 25# yarn26yarn add pathe27 28# pnpm29pnpm i pathe30```31 32Import:33 34```js35// ESM / Typescript36import { resolve, matchesGlob } from "pathe";37 38// CommonJS39const { resolve, matchesGlob } = require("pathe");40```41 42Read 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 (the only exception is `delimiter` constant export, it will be set to `;` on windows platform).43 44### Extra utilities45 46Pathe exports some extra utilities that do not exist in standard Node.js [path module](https://nodejs.org/api/path.html).47In order to use them, you can import from `pathe/utils` subpath:48 49```js50import {51  filename,52  normalizeAliases,53  resolveAlias,54  reverseResolveAlias,55} from "pathe/utils";56```57 58## License59 60Made with ๐Ÿ’› Published under the [MIT](./LICENSE) license.61 62Some code was used from the Node.js project. Glob supported is powered by [zeptomatch](https://github.com/fabiospampinato/zeptomatch).63 64<!-- Refs -->65 66[npm-v-src]: https://img.shields.io/npm/v/pathe?style=flat-square67[npm-v-href]: https://npmjs.com/package/pathe68[npm-d-src]: https://img.shields.io/npm/dm/pathe?style=flat-square69[npm-d-href]: https://npmjs.com/package/pathe70[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/pathe/ci/main?style=flat-square71[github-actions-href]: https://github.com/unjs/pathe/actions?query=workflow%3Aci72[size-src]: https://packagephobia.now.sh/badge?p=pathe73[size-href]: https://packagephobia.now.sh/result?p=pathe74 
basant307/AI_Governance_Project ยท CoolFace