
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@types/whatwg-url
Advanced tools
TypeScript definitions for 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.
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'
The 'url' package is a Node.js core module that provides utilities for URL resolution and parsing. It is not as compliant with the WHATWG URL Standard as whatwg-url, but it is widely used in Node.js applications.
The 'url-parse' package is a lightweight URL parser that works in both Node.js and browser environments. It provides a similar API to whatwg-url but is not fully compliant with the WHATWG URL Standard.
The 'query-string' package focuses on parsing and stringifying URL query strings. While it does not provide full URL parsing and manipulation capabilities, it is useful for handling query parameters specifically.
npm install --save @types/whatwg-url
This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url
Additional Details
These definitions were written by Alexander Marks https://github.com/aomarks.
FAQs
TypeScript definitions for whatwg-url
The npm package @types/whatwg-url receives a total of 4,546,940 weekly downloads. As such, @types/whatwg-url popularity was classified as popular.
We found that @types/whatwg-url demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.