{"name":"pathe","version":"2.0.2","license":"MIT","_id":"pathe@2.0.2","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"},{"name":"danielroe","email":"daniel@roe.dev"}],"homepage":"https://github.com/unjs/pathe#readme","bugs":{"url":"https://github.com/unjs/pathe/issues"},"dist":{"shasum":"5ed86644376915b3c7ee4d00ac8c348d671da3a5","tarball":"http://registry-npm.ywwl.com/pathe/download/pathe-2.0.2.tgz","fileCount":16,"integrity":"sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==","signatures":[{"sig":"MEQCIAIEu+nGDOunDC+HMDHW4IWUaegzcaKuaylf8OGfih8NAiBVCUqLojUdChWHpfe/OZlOrOs9F1B8tI2Z0BL2zRTMcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51362,"size":10505,"noattachment":false,"key":"/pathe/-/pathe-2.0.2.tgz"},"main":"./dist/index.cjs","type":"module","_from":"file:pathe-2.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./utils":{"import":{"types":"./dist/utils.d.mts","default":"./dist/utils.mjs"},"require":{"types":"./dist/utils.d.cts","default":"./dist/utils.cjs"}}},"scripts":{"dev":"vitest","lint":"eslint . && prettier -c src test","test":"pnpm lint && vitest run --coverage","build":"unbuild","release":"pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags","lint:fix":"eslint . --fix && prettier -w src test","test:types":"tsc --noEmit"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"_resolved":"/private/var/folders/hq/c07mx_4n6tg50tlvwps5l8600000gn/T/8c6c92d3a49c5d7903758d1692583916/pathe-2.0.2.tgz","_integrity":"sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==","repository":{"url":"git+https://github.com/unjs/pathe.git","type":"git"},"_npmVersion":"10.9.2","description":"Universal filesystem path utils","directories":{},"sideEffects":false,"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.4.2","eslint":"^9.18.0","vitest":"^3.0.1","esbuild":"^0.24.2","unbuild":"^3.3.1","prettier":"^3.4.2","typescript":"^5.7.3","zeptomatch":"^2.0.0","@types/node":"^22.10.7","changelogen":"^0.5.7","eslint-config-unjs":"^0.4.2","@vitest/coverage-v8":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/pathe_2.0.2_1737118711924_0.6051132592521362","host":"s3://npm-registry-packages-npm-production"},"readme":"# 🛣️ pathe\n\n> Universal filesystem path utils\n\n[![version][npm-v-src]][npm-v-href]\n[![downloads][npm-d-src]][npm-d-href]\n[![size][size-src]][size-href]\n\n## ❓ Why\n\nFor [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.**\n\nCompared 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**!\n\nThis 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.\n\n## 💿 Usage\n\nInstall using npm or yarn:\n\n```bash\n# npm\nnpm i pathe\n\n# yarn\nyarn add pathe\n\n# pnpm\npnpm i pathe\n```\n\nImport:\n\n```js\n// ESM / Typescript\nimport { resolve, matchesGlob } from \"pathe\";\n\n// CommonJS\nconst { resolve, matchesGlob } = require(\"pathe\");\n```\n\nRead 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).\n\n### Extra utilities\n\nPathe exports some extra utilities that do not exist in standard Node.js [path module](https://nodejs.org/api/path.html).\nIn order to use them, you can import from `pathe/utils` subpath:\n\n```js\nimport {\n  filename,\n  normalizeAliases,\n  resolveAlias,\n  reverseResolveAlias,\n} from \"pathe/utils\";\n```\n\n## License\n\nMade with 💛 Published under the [MIT](./LICENSE) license.\n\nSome code was used from the Node.js project. Glob supported is powered by [zeptomatch](https://github.com/fabiospampinato/zeptomatch).\n\n<!-- Refs -->\n\n[npm-v-src]: https://img.shields.io/npm/v/pathe?style=flat-square\n[npm-v-href]: https://npmjs.com/package/pathe\n[npm-d-src]: https://img.shields.io/npm/dm/pathe?style=flat-square\n[npm-d-href]: https://npmjs.com/package/pathe\n[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/pathe/ci/main?style=flat-square\n[github-actions-href]: https://github.com/unjs/pathe/actions?query=workflow%3Aci\n[size-src]: https://packagephobia.now.sh/badge?p=pathe\n[size-href]: https://packagephobia.now.sh/result?p=pathe\n","publish_time":1737118712081,"_cnpm_publish_time":1737118712081,"dist-tags":{"latest":"2.0.3"}}