{"name":"bare-url","version":"2.4.4","author":{"name":"Holepunch"},"license":"Apache-2.0","_id":"bare-url@2.4.4","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/holepunchto/bare-url","bugs":{"url":"https://github.com/holepunchto/bare-url/issues"},"dist":{"shasum":"55b5246d07e7aea1feca82eec16124025d55ccab","tarball":"http://registry-npm.ywwl.com/bare-url/download/bare-url-2.4.4.tgz","fileCount":27,"integrity":"sha512-zbQJi2YQUe3SrX19TItQ8DoPj9E1i5rrdE9iHV4PhUif1GodNRSe85lavVGbmU7P4M8579EQi4akGFuhCATWaQ==","signatures":[{"sig":"MEYCIQC/w5RcCDChwvK7EzMUvyB718lDdg8AdGOK+qHnCpiiRAIhAKPsT2z0Zc7lCj2mLv19KegnEK3fQhnK6EJVoFj/dI+n","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/bare-url@2.4.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1533833,"size":635086,"noattachment":false,"key":"/bare-url/-/bare-url-2.4.4.tgz"},"addon":true,"types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./global":{"types":"./global.d.ts","default":"./global.js"},"./package":"./package.json"},"gitHead":"33de0f18b44a79f766929a447ac05db8cdd047be","scripts":{"lint":"prettier --check . && lunte","test":"brittle-bare --coverage test.js","format":"prettier --write . && lunte --fix"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6baa2f2a-919b-4a9e-b5b9-48ad9c05e115"}},"repository":{"url":"git+https://github.com/holepunchto/bare-url.git","type":"git"},"_npmVersion":"11.13.0","description":"WHATWG URL implementation for JavaScript","directories":{},"_nodeVersion":"24.16.0","dependencies":{"bare-path":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"lunte":"^1.6.0","brittle":"^3.3.2","prettier":"^3.3.3","cmake-bare":"^1.1.6","cmake-fetch":"^1.0.0","prettier-config-holepunch":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bare-url_2.4.4_1780561983324_0.7919765291851943","host":"s3://npm-registry-packages-npm-production"},"readme":"# bare-url\n\nWHATWG URL implementation for JavaScript, built on <https://github.com/holepunchto/liburl>. Provides `URL` and `URLSearchParams` classes compatible with the WHATWG URL Standard.\n\n```\nnpm i bare-url\n```\n\n## Usage\n\n```js\nconst { URL, URLSearchParams } = require('bare-url')\n\nconst url = new URL('https://example.com/path?foo=bar#hash')\n\nconsole.log(url.hostname) // 'example.com'\nconsole.log(url.pathname) // '/path'\nconsole.log(url.searchParams.get('foo')) // 'bar'\n```\n\nTo register `URL` and `URLSearchParams` as globals:\n\n```js\nrequire('bare-url/global')\n```\n\n## API\n\n#### `const url = new URL(input[, base])`\n\nParse `input` as a URL. If `base` is provided, `input` is resolved relative to `base`. Throws if `input` is not a valid URL.\n\n#### `url.href`\n\nThe full serialized URL string. Setting this property reparses the URL.\n\n#### `url.protocol`\n\nThe URL scheme followed by `':'`, e.g. `'https:'`.\n\n#### `url.username`\n\nThe username portion of the URL, or an empty string.\n\n#### `url.password`\n\nThe password portion of the URL, or an empty string.\n\n#### `url.host`\n\nThe hostname and port, e.g. `'example.com:8080'`.\n\n#### `url.hostname`\n\nThe hostname without the port.\n\n#### `url.port`\n\nThe port as a string, or an empty string if not present.\n\n#### `url.pathname`\n\nThe path portion of the URL.\n\n#### `url.search`\n\nThe query string including the leading `'?'`, or an empty string.\n\n#### `url.searchParams`\n\nA `URLSearchParams` object for the query string. Mutations to the params are reflected in the URL.\n\n#### `url.hash`\n\nThe fragment including the leading `'#'`, or an empty string.\n\n#### `url.toString()`\n\nReturns the serialized URL string. Equivalent to `url.href`.\n\n#### `url.toJSON()`\n\nReturns the serialized URL string. Suitable for JSON serialization.\n\n#### `const params = new URLSearchParams([init])`\n\nCreate a new `URLSearchParams` instance. `init` may be a query string, an iterable of `[name, value]` pairs, or an object of key-value pairs.\n\n#### `params.size`\n\nThe total number of search parameters.\n\n#### `params.append(name, value)`\n\nAppend a new `name`/`value` pair.\n\n#### `params.delete(name[, value])`\n\nRemove all pairs with `name`. If `value` is provided, only pairs with both the matching `name` and `value` are removed.\n\n#### `params.get(name)`\n\nReturn the first value for `name`, or `null` if not present.\n\n#### `params.getAll(name)`\n\nReturn all values for `name` as an array.\n\n#### `params.has(name[, value])`\n\nReturn `true` if a pair with `name` exists. If `value` is provided, the pair must also match `value`.\n\n#### `params.set(name, value)`\n\nSet the value for `name`, replacing any existing pairs with that name.\n\n#### `params.toString()`\n\nReturn the serialized query string without the leading `'?'`.\n\n#### `params.toJSON()`\n\nReturn the parameters as an array of `[name, value]` pairs.\n\n#### `URL.isURL(value)`\n\nReturn `true` if `value` is a `URL` instance.\n\n#### `URLSearchParams.isURLSearchParams(value)`\n\nReturn `true` if `value` is a `URLSearchParams` instance.\n\n#### `const url = URL.parse(input[, base])`\n\nParse `input` as a URL without throwing. Returns a `URL` instance on success, or `null` on failure.\n\n#### `const valid = URL.canParse(input[, base])`\n\nReturn `true` if `input` can be parsed as a valid URL, optionally relative to `base`.\n\n#### `const pathname = URL.fileURLToPath(url)`\n\nConvert a `file:` URL to a platform-specific file path. `url` may be a `URL` instance or a string. Throws if the URL does not use the `file:` protocol or contains invalid path characters.\n\n#### `const url = URL.pathToFileURL(pathname)`\n\nConvert a platform-specific file path to a `file:` URL.\n\n#### `const href = URL.format(parts)`\n\nFormat a URL from individual `parts`:\n\n```js\nparts = {\n  protocol,\n  auth,\n  host,\n  hostname,\n  port,\n  pathname,\n  search,\n  query,\n  hash,\n  slashes\n}\n```\n\nAll properties are optional. If `host` is provided, `hostname` and `port` are ignored. If `search` is provided, `query` is ignored. Set `slashes` to `true` to include `'//'` after the protocol.\n\n## License\n\nApache-2.0\n","publish_time":1780561983482,"_cnpm_publish_time":1780561983482,"dist-tags":{"latest":"2.5.5"}}