{"name":"url-or-path","version":"0.0.2","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"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"ava":{"verbose":true},"devDependencies":{"@commitlint/cli":"13.1.0","@fisker/commitlint-config":"1.3.6","@fisker/eslint-config":"7.2.0","@fisker/eslint-config-ava":"2.0.2","@fisker/husky-config":"4.1.0","@fisker/lint-staged-config":"3.1.0","@fisker/prettier-config":"4.1.1","ava":"3.15.0","c8":"7.8.0","cz-conventional-changelog":"3.3.0","del-cli":"4.0.1","eslint":"7.32.0","husky":"7.0.2","lint-staged":"11.1.2","markdownlint-cli":"0.28.1","npm-run-all":"4.1.5","prettier":"2.3.2","sort-package-json":"1.50.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"c8":{"reporter":["lcov","text"]},"gitHead":"74cc105a3f21558e7f061c4333065df2d9e3343c","_id":"url-or-path@0.0.2","_nodeVersion":"16.7.0","_npmVersion":"7.9.0","dist":{"integrity":"sha512-2cjexOZIMGocse3Rdo7SUSQUNBt8eEZ3/Je4Q/XxQG/kSxIUyaO2WmAMl/8UAuj9giRS2JZMYv9NjMQDZ6jCVg==","shasum":"a868814d80f469f8a17b86dbfcd376b6ddbeecb1","tarball":"http://registry-npm.ywwl.com/url-or-path/download/url-or-path-0.0.2.tgz","fileCount":4,"unpackedSize":5784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJcdsCRA9TVsSAnZWagAATtEP/38EdlDyJ3w7aE8sl5pk\nBqWr+ydNhMf7buD+024aKEyeE9BL0nQrZjBy3XVA8YsMRJrSiSsibL2qZW7i\nJ3Oips/CtqWZVRg9cKr/TydCzy/n1UN4aq1RRCtV+V7Ijf4od+D6c4yBJEiO\nSK7aPnBmJZH0oL1peiqZPJf7+Fz0IOrLVRRLc5LjJhG1AJ6hKnisKwgA0StE\ngdbEKqxCMzof0/IKBLA5Oy1NExHGI4K6eIwo9jQnATpRUmr9FYOAHFmyioch\nRevoEE9pMf5/TsdNcNCG7XKo9u4ge11VnGakhfhAOTsHdQjb1vSCQkSQwshu\nQn1s2Tnt2My94DaDYLVLIlG5JLoGVpLMwh2c4ZVHl0vIVsTBR51koAaGOokS\ny8HD6bKEfrAAtzaNy5X42dHSVd5eBvCmT4vkvDhopdO0AjUMdnKH8cpYXGbJ\noqfymKC4FuRDicA40FAEuzuj8/r/a2KOoQYi97I3z+Rlf4D9/xxftmqjseOa\nTihzq1g7CajUwsctkCKt9xjOvVVLk/ppBQPbog39R2BCq3wzIM8eFKjwc719\n9ix3jyPzsyY8WeeWx1vg/9/yIPXcKtPi711T+t6rf1k1Z/xizkT7PAYS/F1F\nRapqysT/eXLZhBqI4/P9+YQB7iGV5RyU+Za6YF6pLcc/oy+kxd++Vx7AB9pY\nlF0z\r\n=fuXM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOCGw5a7d87essMLyiQmPf1D16d348W7vgG+F0uA96oAiEApRiKFwYhbhH2XzkJViLBtrIQNXoEqLLN1O+ZDLqvmQQ="}],"size":2527,"noattachment":false,"key":"/url-or-path/-/url-or-path-0.0.2.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_0.0.2_1629865835916_0.5901288523349615"},"_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":1629865836031,"_cnpm_publish_time":1629865836031,"dist-tags":{"latest":"2.7.1"}}