{"name":"pathe","version":"2.0.3","description":"Universal filesystem path utils","repository":{"type":"git","url":"git+https://github.com/unjs/pathe.git"},"license":"MIT","sideEffects":false,"type":"module","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"}}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","devDependencies":{"@types/node":"^22.13.1","@vitest/coverage-v8":"^3.0.5","changelogen":"^0.5.7","esbuild":"^0.25.0","eslint":"^9.20.1","eslint-config-unjs":"^0.4.2","jiti":"^2.4.2","prettier":"^3.5.0","typescript":"^5.7.3","unbuild":"^3.3.1","vitest":"^3.0.5","zeptomatch":"^2.0.0"},"scripts":{"build":"unbuild","dev":"vitest","lint":"eslint . && prettier -c src test","lint:fix":"eslint . --fix && prettier -w src test","release":"pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags","test":"pnpm lint && vitest run --coverage","test:types":"tsc --noEmit"},"_id":"pathe@2.0.3","bugs":{"url":"https://github.com/unjs/pathe/issues"},"homepage":"https://github.com/unjs/pathe#readme","_integrity":"sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==","_resolved":"/private/var/folders/hq/c07mx_4n6tg50tlvwps5l8600000gn/T/15e46780c8f375ff733b6a4d49e4b75e/pathe-2.0.3.tgz","_from":"file:pathe-2.0.3.tgz","_nodeVersion":"22.13.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==","shasum":"3ecbec55421685b70a9da872b2cff3e1cbed1716","tarball":"http://registry-npm.ywwl.com/pathe/download/pathe-2.0.3.tgz","fileCount":16,"unpackedSize":51332,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDzM704JU5xv2pHW6vgkO9qvD2Ol5+/NegZnN5zKrnOfQIgQTONgEww6dMrAOJCeXz2w/EKhJEnU4gznS3Qdnh62v8="}],"size":10514,"noattachment":false,"key":"/pathe/-/pathe-2.0.3.tgz"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"},{"name":"danielroe","email":"daniel@roe.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pathe_2.0.3_1739303255661_0.5690093091666735"},"_hasShrinkwrap":false,"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":1739303255862,"_cnpm_publish_time":1739303255862,"dist-tags":{"latest":"2.0.3"}}