{"name":"url-or-path","version":"2.7.1","description":"Convert between file URL and path.","homepage":"https://github.com/fisker/url-or-path#readme","bugs":{"url":"https://github.com/fisker/url-or-path/issues"},"repository":{"type":"git","url":"git+https://github.com/fisker/url-or-path.git"},"funding":"https://github.com/fisker/url-or-path?sponsor=1","license":"MIT","author":{"name":"fisker Cheung","email":"lionkay@gmail.com","url":"https://www.fiskercheung.com/"},"sideEffects":false,"type":"module","exports":"./index.js","scripts":{"build":"yarn clean && run-p \"build:*\"","build:types":"tsc --emitDeclarationOnly --noEmit false && yarn fix:prettier","clean":"run-p \"clean:*\"","clean:dist":"del-cli dist","dist":"run-p \"dist:*\"","dist:npm":"release-it","fix":"run-p --continue-on-error \"fix:*\"","fix:eslint":"yarn lint:eslint --fix","fix:markdown":"yarn lint:markdown --fix","fix:package-json":"sort-package-json \"package.json\" \"packages/*/package.json\"","fix:prettier":"prettier . --write","lint":"run-p --continue-on-error \"lint:*\"","lint:eslint":"eslint .","lint:markdown":"markdownlint-cli2","lint:package-json":"yarn run fix:package-json --check","lint:prettier":"prettier . --check","release":"run-s fix build test dist","test":"run-p \"test:*\"","test:js":"ava","test:types":"yarn build && tsd","test-coverage":"c8 yarn test"},"ava":{"verbose":true},"c8":{"reporter":["lcov","text"]},"devDependencies":{"@fisker/eslint-config":"16.0.0","@fisker/eslint-config-ava":"5.0.0","@fisker/markdownlint-cli2-config":"0.1.0","@fisker/prettier-config":"6.0.0","@fisker/release-it-config":"6.0.2","@types/node":"25.9.3","ava":"8.0.1","c8":"11.0.0","del-cli":"7.0.0","eslint":"10.4.1","markdownlint-cli2":"0.22.1","npm-run-all2":"9.0.1","prettier":"3.8.4","release-it":"20.2.0","sort-package-json":"4.0.0","tsd":"0.33.0","typescript":"6.0.3"},"packageManager":"yarn@4.16.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"a962986b6400c432f6790257265fe8520e193f11","types":"./index.d.ts","_id":"url-or-path@2.7.1","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-yqupBu6PcWOyp5UnBw8IK6vhRVfnGe6feEvbHgUN4rJvJMjhJRFrsac/uWAEFl5fAqpuqbE4kW+wsIt19cSS8g==","shasum":"57f6b5a3c972cdf85d0bdc29c94e45bfa932ad8e","tarball":"http://registry-npm.ywwl.com/url-or-path/download/url-or-path-2.7.1.tgz","fileCount":5,"unpackedSize":9589,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/url-or-path@2.7.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHq84g9l5O5gpkT0/kSl559j7h/Qq4vUVSXMPeoo9YVtAiASddzdAwnCD3gmg6CsAIbwOiLrvdOQO550kAbGHxZbrQ=="}],"size":3111,"noattachment":false,"key":"/url-or-path/-/url-or-path-2.7.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:89e97618-5483-4c59-959b-ab664810b340"}},"directories":{},"maintainers":[{"name":"fisker","email":"lionkay@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/url-or-path_2.7.1_1781305278931_0.7036457374858629"},"_hasShrinkwrap":false,"readme":"# url-or-path\n\n[![Build Status][github_actions_badge]][github_actions_link]\n[![Coverage][coveralls_badge]][coveralls_link]\n[![Npm Version][package_version_badge]][package_link]\n[![MIT License][license_badge]][license_link]\n\n[github_actions_badge]: https://img.shields.io/github/actions/workflow/status/fisker/url-or-path/continuous-integration.yml?barnach=main&style=flat-square\n[github_actions_link]: https://github.com/fisker/url-or-path/actions?query=branch%3Amain\n[coveralls_badge]: https://img.shields.io/coveralls/github/fisker/url-or-path/main?style=flat-square\n[coveralls_link]: https://coveralls.io/github/fisker/url-or-path?branch=main\n[license_badge]: https://img.shields.io/npm/l/prettier-format.svg?style=flat-square\n[license_link]: https://github.com/fisker/url-or-path/blob/main/license\n[package_version_badge]: https://img.shields.io/npm/v/url-or-path.svg?style=flat-square\n[package_link]: https://www.npmjs.com/package/url-or-path\n\n> Convert between file URL and path.\n\n## Install\n\n```bash\nyarn add url-or-path\n```\n\n## Usage\n\n```js\nimport {toUrl, toPath} from 'url-or-path'\n\nconsole.log(toUrl(urlOrPath))\n//=> URL {/* ... */}\n\nconsole.log(toPath(urlOrPath))\n//=> 'path/to/file'\n```\n\n## API\n\n### `toUrl(urlOrPath)`(alias `toURL`)\n\nType: `string | URL`\n\nReturns a [`URL`](https://nodejs.org/dist/latest-v16.x/docs/api/url.html#url_class_url) object of given URL or path string.\n\n### `toPath(urlOrPath)`\n\nType: `string | URL`\n\nReturns path string of given URL or path string.\n\n### `toAbsolute(urlOrPath)`\n\nType: `string | URL`\n\nReturns absolute path string of given URL or path string.\n\n### `toDirectory(urlOrPath)`\n\nType: `string | URL`\n\nSame as `toUrl`, but the result URL always ends with `/`.\n\n### `isUrl(value)`(alias `isURL`)\n\nCheck if `value` is a `URL` instance or a string starts with `file://`.\n\n### `isUrlInstance(value)`(alias `isURLInstance`)\n\nCheck if `value` is a `URL` instance.\n\n### `isUrlString(value)`(alias `isURLString`)\n\nCheck if `value` is a string starts with `file://`.\n","publish_time":1781305279129,"_cnpm_publish_time":1781305279129,"dist-tags":{"latest":"2.7.1"}}