Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 31, 2024 via pnpm

whatwg-url 11.0.0

An implementation of the WHATWG URL Standard's URL API and parsing machinery
Package summary
Share
0
issues
2
licenses
3
MIT
1
BSD-2-Clause
Package created
4 Jun 2015
Version published
19 Oct 2021
Maintainers
6
Total deps
4
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
punycode@2.3.1
tr46@3.0.0
whatwg-url@11.0.0

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
webidl-conversions@7.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of whatwg-url 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
tr463.0.059.78 kBMIT
prod
webidl-conversions7.0.07.38 kBBSD-2-Clause
prod

Visualizations

Frequently Asked Questions

What does whatwg-url do?

The whatwg-url package is a complete implementation of the WHATWG URL Standard. This npm package can be used standalone or for integrating a URL parser into a project. The URL API and parsing algorithm that are being followed by this package are up to date with the URL specifications stated in the standard.

How do you use whatwg-url?

To use the whatwg-url package in your JavaScript project, first install the package from npm using the command npm install whatwg-url. Once installed, you can import the package in your modules using the require keyword like this:

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

You can now create and manipulate URL objects using the URL and URLSearchParams classes as per the WHATWG URL standard. For example:

const myURL = new URL('https://example.org/foo#bar');
console.log(myURL.hash);  // Outputs: #bar

const params = new URLSearchParams('q=test&p=123');
console.log(params.get('q'));  // Outputs: test

You can also use the low-level URL standard APIs provided by the package to manipulate URL records. Here is an example of how to parse a URL using parseURL method:

const { parseURL } = require('whatwg-url');
const urlRecord = parseURL('https://example.org/foo#bar');
console.log(urlRecord.scheme);  // Outputs: https

Where are the whatwg-url docs?

The comprehensive documentation for the whatwg-url package lies within the WHATWG URL Standard. Moreover, detail of the low-level APIs, such as specific methods and their parameters, is listed in the readme file on the package's GitHub repository. The URL record type API is also fully explained in the readme. Developers can also refer to the URL and the URLSearchParams in the URL standard for more information.