Skip to main content

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 URL Standard. 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 the four 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 an invalid domain, the empty string is returned.

    f
    domainToUnicode

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

      f
      fileURLToPath

      This function ensures the correct decodings of percent-encoded characters as well 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 URL control 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 a manner 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 as expected 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
                  UrlWithParsedQuery
                  No documentation available
                  I
                  UrlWithStringQuery
                  No documentation available
                  Back to top