Skip to main content
url - Node documentation

Usage in Deno

import * as mod from "node:url";

The node:url module provides utilities for URL resolution and parsing. It can be accessed using:

import url from 'node:url';

Classes

c
I
v
URL

Browser-compatible URL class, implemented by following the WHATWG URLStandard. Examples of parsed URLs may be found in the Standard itself.The URL class is also available on the global object.

c
I
v
URLSearchParams

The URLSearchParams API provides read and write access to the query of a URL. The URLSearchParams class can also be used standalone with one of thefour following constructors.The URLSearchParams class is also available on the global object.

Functions

f
domainToASCII

Returns the Punycode ASCII serialization of the domain. If domain is aninvalid domain, the empty string is returned.

f
domainToUnicode

Returns the Unicode serialization of the domain. If domain is an invaliddomain, the empty string is returned.

f
fileURLToPath

This function ensures the correct decodings of percent-encoded characters aswell as ensuring a cross-platform valid absolute path string.

f
format

The url.format() method returns a formatted URL string derived from urlObject.

f
parse
No documentation available
f
pathToFileURL

This function ensures that path is resolved absolutely, and that the URLcontrol characters are correctly encoded when converting into a File URL.

f
resolve

The url.resolve() method resolves a target URL relative to a base URL in amanner similar to that of a web browser resolving an anchor tag.

f
urlToHttpOptions

This utility function converts a URL object into an ordinary options object asexpected by the http.request() and https.request() APIs.

Interfaces

I
FileUrlToPathOptions
No documentation available
I
Global
No documentation available
I
PathToFileUrlOptions
No documentation available
I
URLFormatOptions
No documentation available
I
UrlWithParsedQuery
No documentation available
I
UrlWithStringQuery
No documentation available