Dev Helpers
← Back

Normalize a default port

Normalize a default port using Node.js.

Open this example in the interactive library

Source code

import {
  URL,
  domainToASCII,
  domainToUnicode,
  pathToFileURL,
  fileURLToPath,
} from "node:url";
console.log(new URL("https://example.org:443/a").href);

Sample output

https://example.org/a