You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@types/whatwg-url

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/whatwg-url

TypeScript definitions for whatwg-url


Version published
Weekly downloads
4M
increased by1.58%
Maintainers
1
Install size
21.1 kB
Created
Weekly downloads
 

Package description

What is @types/whatwg-url?

@types/whatwg-url provides TypeScript type definitions for the whatwg-url package, which is a JavaScript implementation of the URL Standard. This package allows developers to parse, serialize, and manipulate URLs in a way that is compliant with the WHATWG URL Standard.

What are @types/whatwg-url's main functionalities?

URL Parsing

This feature allows you to parse a URL string into a URL object, which provides properties and methods to access different parts of the URL.

const { URL } = require('whatwg-url');
const myURL = new URL('https://example.com/path?name=value#hash');
console.log(myURL.hostname); // 'example.com'

URL Serialization

This feature allows you to serialize a URL object back into a string, which can be useful for generating URLs dynamically.

const { URL } = require('whatwg-url');
const myURL = new URL('https://example.com/path?name=value#hash');
console.log(myURL.href); // 'https://example.com/path?name=value#hash'

URL Manipulation

This feature allows you to manipulate different parts of the URL, such as the pathname, search parameters, and hash.

const { URL } = require('whatwg-url');
const myURL = new URL('https://example.com/path?name=value#hash');
myURL.pathname = '/newpath';
console.log(myURL.href); // 'https://example.com/newpath?name=value#hash'

Other packages similar to @types/whatwg-url

Readme

Source

Installation

npm install --save @types/whatwg-url

Summary

This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url.

Additional Details

Credits

These definitions were written by Alexander Marks, ExE Boss, and BendingBender.

FAQs

Package last updated on 18 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc