site-panzai/node_modules/bare-url
2026-11-13 13:57:04 +01:00
..
lib first commit 2026-11-13 13:57:04 +01:00
prebuilds first commit 2026-11-13 13:57:04 +01:00
binding.c first commit 2026-11-13 13:57:04 +01:00
binding.js first commit 2026-11-13 13:57:04 +01:00
CMakeLists.txt first commit 2026-11-13 13:57:04 +01:00
global.d.ts first commit 2026-11-13 13:57:04 +01:00
global.js first commit 2026-11-13 13:57:04 +01:00
index.d.ts first commit 2026-11-13 13:57:04 +01:00
index.js first commit 2026-11-13 13:57:04 +01:00
LICENSE first commit 2026-11-13 13:57:04 +01:00
package.json first commit 2026-11-13 13:57:04 +01:00
README.md first commit 2026-11-13 13:57:04 +01:00

bare-url

WHATWG URL implementation for JavaScript, built on https://github.com/holepunchto/liburl. Provides URL and URLSearchParams classes compatible with the WHATWG URL Standard.

npm i bare-url

Usage

const { URL, URLSearchParams } = require('bare-url')

const url = new URL('https://example.com/path?foo=bar#hash')

console.log(url.hostname) // 'example.com'
console.log(url.pathname) // '/path'
console.log(url.searchParams.get('foo')) // 'bar'

To register URL and URLSearchParams as globals:

require('bare-url/global')

API

See the bare-url reference.

Threat model

bare-url is one of the addons Bare compiles into its binary, so it inherits Bare's threat model. See docs/threat-model.md for where this addon sits in it.

License

Apache-2.0