{"name":"url-or-path","version":"2.3.2","author":{"url":"https://www.fiskercheung.com/","name":"fisker Cheung","email":"lionkay@gmail.com"},"license":"MIT","_id":"url-or-path@2.3.2","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":"c0369727f143f260902f6874590faea88dc4de00","tarball":"http://registry-npm.ywwl.com/url-or-path/download/url-or-path-2.3.2.tgz","fileCount":6,"integrity":"sha512-DOI9KXk0bc/JOmFQHbn25knW2GX/ym7+egKFEFApG3VdDzRlLBMCIrMnruq4AZUGop1W0aiYQ5Vry6clzhxcOQ==","signatures":[{"sig":"MEUCIA+XBmshAv2tyejyOru2N1adSbcIzh0l5aiRJVx7YOs0AiEA9elKq6RgxKs/HL8qCR3Kj7fOzNOkOWq4V6HIZfxNUO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8668,"size":3330,"noattachment":false,"key":"/url-or-path/-/url-or-path-2.3.2.tgz"},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":"https://github.com/fisker/url-or-path?sponsor=1","gitHead":"bc87e038d0023e53fb031e187cec9c3f0a760b24","scripts":{"dist":"run-p dist:*","lint":"run-p lint:*","test":"run-p \"test:*\"","build":"yarn clean && run-p \"build:*\"","clean":"run-p \"clean:*\"","format":"run-p format:*","prepare":"husky install","release":"run-s format build test dist","test:js":"ava","dist:npm":"np --yolo --no-yarn","clean:dist":"del-cli index.d.ts index.d.ts.map","test:types":"yarn build && tsd","build:types":"tsc --emitDeclarationOnly --noEmit false","lint:eslint":"eslint \"**/*.{js,mjs,cjs,vue}\"","format:eslint":"yarn lint:eslint --fix","lint:markdown":"markdownlint2 \"**/*.md\"","lint:prettier":"prettier \"**/*.{css,html,js,cjs,mjs,json,less,md,scss,ts,vue,yaml,yml}\" --check","test-coverage":"c8 yarn test","format:markdown":"markdownlint-cli2-fix \"**/*.md\"","format:prettier":"yarn lint:prettier --write","lint:package-json":"yarn run format:package-json --check","format:package-json":"sort-package-json \"package.json\" \"packages/*/package.json\""},"_npmUser":{"name":"fisker","email":"lionkay@gmail.com"},"repository":{"url":"git+https://github.com/fisker/url-or-path.git","type":"git"},"_npmVersion":"10.7.0","description":"Convert between file URL and path.","directories":{},"sideEffects":false,"_nodeVersion":"20.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"c8":"8.0.1","ava":"5.3.1","tsd":"0.29.0","husky":"8.0.3","eslint":"8.54.0","del-cli":"5.1.0","prettier":"3.1.0","typescript":"5.2.2","@types/node":"20.9.2","lint-staged":"15.1.0","npm-run-all2":"6.1.1","markdownlint-cli2":"0.10.0","sort-package-json":"2.6.0","@fisker/husky-config":"4.1.3","@fisker/eslint-config":"12.0.0","@fisker/prettier-config":"5.1.1","@fisker/eslint-config-ava":"2.0.6","@fisker/lint-staged-config":"3.3.1"},"_npmOperationalInternal":{"tmp":"tmp/url-or-path_2.3.2_1730258254485_0.555899429413786","host":"s3://npm-registry-packages"},"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":1730258254669,"_cnpm_publish_time":1730258254669,"dist-tags":{"latest":"2.7.1"}}