{"name":"url-or-path","version":"2.5.0","author":{"url":"https://www.fiskercheung.com/","name":"fisker Cheung","email":"lionkay@gmail.com"},"license":"MIT","_id":"url-or-path@2.5.0","maintainers":[{"name":"fisker","email":"lionkay@gmail.com"}],"homepage":"https://github.com/fisker/url-or-path#readme","bugs":{"url":"https://github.com/fisker/url-or-path/issues"},"c8":{"reporter":["lcov","text"]},"ava":{"verbose":true},"dist":{"shasum":"2053cd81db2d6c43d9008e4e06416f382504c44f","tarball":"http://registry-npm.ywwl.com/url-or-path/download/url-or-path-2.5.0.tgz","fileCount":5,"integrity":"sha512-RCHv4JxhqDmXHix65rBDD98E5eIct7Md2ps0Vr1j2cH4GLW+yzW7c5t6K4vfLCHcpVDv3NFdBJKmJxpG3Y+3CA==","signatures":[{"sig":"MEYCIQDHV60iUexZGTEC40OaEbq3LJBK96jbSzLyWeu2XTjaFwIhALC5cc8jRWRJzU4y57ES3JYNEYxLpCBfVI/P9a+huLZ6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8577,"size":3055,"noattachment":false,"key":"/url-or-path/-/url-or-path-2.5.0.tgz"},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":"https://github.com/fisker/url-or-path?sponsor=1","gitHead":"34008169a1b9e926e711b1b8ccbccf9b082eb436","scripts":{"fix":"run-p --continue-on-error \"fix:*\"","dist":"run-p \"dist:*\"","lint":"run-p --continue-on-error \"lint:*\"","test":"run-p \"test:*\"","build":"yarn clean && run-p \"build:*\"","clean":"run-p \"clean:*\"","prepare":"husky install","release":"run-s fix build test dist","test:js":"ava","dist:npm":"release-it","clean:dist":"del-cli dist","fix:eslint":"yarn lint:eslint --fix","test:types":"yarn build && tsd","build:types":"tsc --emitDeclarationOnly --noEmit false && yarn fix:prettier","lint:eslint":"eslint .","fix:markdown":"yarn lint:markdown --fix","fix:prettier":"prettier . --write","lint:markdown":"markdownlint-cli2","lint:prettier":"prettier . --check","test-coverage":"c8 yarn test","fix:package-json":"sort-package-json \"package.json\" \"packages/*/package.json\"","lint:package-json":"yarn run fix:package-json --check"},"_npmUser":{"name":"fisker","email":"lionkay@gmail.com"},"repository":{"url":"git+https://github.com/fisker/url-or-path.git","type":"git"},"_npmVersion":"9.1.2","description":"Convert between file URL and path.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.1","devDependencies":{"c8":"10.1.3","ava":"6.2.0","tsd":"0.32.0","husky":"9.1.7","eslint":"9.25.1","del-cli":"6.0.0","prettier":"3.5.3","release-it":"19.0.1","typescript":"5.8.3","@types/node":"22.15.2","lint-staged":"15.5.1","npm-run-all2":"7.0.2","markdownlint-cli2":"0.17.2","sort-package-json":"3.0.0","@fisker/husky-config":"4.1.6","@fisker/eslint-config":"14.0.0","@fisker/prettier-config":"5.1.5","@fisker/eslint-config-ava":"3.0.3","@fisker/lint-staged-config":"3.3.5","@fisker/markdownlint-cli2-config":"0.0.3"},"_npmOperationalInternal":{"tmp":"tmp/url-or-path_2.5.0_1745779128714_0.32325553942561736","host":"s3://npm-registry-packages-npm-production"},"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":1745779128929,"_cnpm_publish_time":1745779128929,"dist-tags":{"latest":"2.7.1"}}