{"name":"url-or-path","version":"2.0.0","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":{"clean":"run-p clean:*","clean:dist":"del-cli dist","dist":"run-p dist:*","dist:npm":"np --yolo --no-yarn","format":"run-p format:*","format:eslint":"yarn lint:eslint --fix","format:markdown":"yarn lint:markdown --fix","format:package-json":"sort-package-json \"package.json\" \"packages/*/package.json\"","format:prettier":"yarn lint:prettier --write","lint":"run-p lint:*","lint:eslint":"eslint \"**/*.{js,mjs,cjs,vue}\"","lint:markdown":"markdownlint \"**/*.md\" --ignore \"**/node_modules/**\"","lint:package-json":"yarn run format:package-json --check","lint:prettier":"prettier \"**/*.{css,html,js,cjs,mjs,json,less,md,scss,ts,vue,yaml,yml}\" --check","test":"ava","test-coverage":"c8 ava","release":"run-s format test dist","prepare":"husky install"},"ava":{"verbose":true},"c8":{"reporter":["lcov","text"]},"devDependencies":{"@fisker/eslint-config":"10.0.12","@fisker/eslint-config-ava":"2.0.5","@fisker/husky-config":"4.1.2","@fisker/lint-staged-config":"3.1.4","@fisker/prettier-config":"5.0.5","ava":"4.0.1","c8":"7.11.0","del-cli":"4.0.1","eslint":"8.8.0","husky":"7.0.4","lint-staged":"12.3.3","markdownlint-cli":"0.31.1","npm-run-all":"4.1.5","prettier":"2.5.1","sort-package-json":"1.54.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"a13e222ec040ce6ab347a4c4e8d87c645dfe3a86","_id":"url-or-path@2.0.0","_nodeVersion":"14.18.3","_npmVersion":"7.9.0","dist":{"integrity":"sha512-I05TRNuI8qek6a1+j0gA5xx+HxgQk1XkcL98ZyeXt0/u4DZuNmJf0MIB9syvU0LIFpgAsvfKxq7k5AN0TldzWA==","shasum":"c9b922d5951a7722a080f44802b5de1eed75cc18","tarball":"http://registry-npm.ywwl.com/url-or-path/download/url-or-path-2.0.0.tgz","fileCount":4,"unpackedSize":5626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBgP3CRA9TVsSAnZWagAAqM0P/2i2DmhjAwYjXbreRDVT\nznjDQc3Hjd+C7wMyZOqg3wqMTWPpOGtCd1q/9NfZTMx7FW0riJ+9VMQXFya1\nbX8jfRDfzNEjUt3HtH2NYTIRSUtyto3bKtON3+AbC/5u9UfGF0T/yQvqyIod\n3Y/+TNBZH7xL0pmy0drVDHSXEWCrLBEx3kr4cWMo77wnliFD5luXoNk2LEd5\nATcRKAUNONAVOJRZ/31IHxjz4HWKMehNgh8OgGTU5cNYOP3+Aa0aOoNbNDOm\nB5MdYJdQ9kfpeAo3XSE1x7aKXfZ0CkYrQ/LDhUIKoNjteyW1zl4pnjWFy4Pi\ny9oVwHkCiGT12i52++OcRSNHYIWnevfhL4iu4HoYfZ6OjPXssp+EUYGCrKam\nJfjI/Y3daFgc9skAK5SqOMGJo9R0s9DTe1RJO09x7DKHbwFSSGV61nMWWM8b\n67CcpsEqMv94MTgHgwNt3uDFneWEn+zgDo0GcjgGKsHgQyfsvp2qdsxgyfUJ\nCFfkqqqygwI0ItWuYYZqQX6al7HENsCbBglYtRYqYnPLf10+w2Jw6xHdexqH\ntaQRtZGlRiKT/KlnHXooJPLaSZeljEcxMoQO4n1nyYJizMO5RoanFiK24Rrj\nWvIotv3ZXExyTFF46UczUFnLsqsiQyLjOBbnGPyrJFRTRUG7umGloubNK+hu\n0/EN\r\n=9CYg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/2t5WTy1SI/Iw5eughTmZ9dxz1MKWMbqIzh7gdi9+5AIgVsWNitLvziOlXzRwkLoyWYHsoi6UkYXA8BrVK9seYqs="}],"size":2467,"noattachment":false,"key":"/url-or-path/-/url-or-path-2.0.0.tgz"},"_npmUser":{"name":"fisker","email":"lionkay@gmail.com"},"directories":{},"maintainers":[{"name":"fisker","email":"lionkay@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-or-path_2.0.0_1644561399669_0.9298654735206284"},"_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### `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":1644561399794,"_cnpm_publish_time":1644561399794,"dist-tags":{"latest":"2.7.1"}}