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)
console.log(url.pathname)
console.log(url.searchParams.get('foo'))
To register URL and URLSearchParams as globals:
require('bare-url/global')
API
See the bare-url reference.
License
Apache-2.0