Open this example in the interactive library
Source code
import {
URL,
domainToASCII,
domainToUnicode,
pathToFileURL,
fileURLToPath,
} from "node:url";
console.log(URL.canParse("/help", "https://example.org"));
Sample output
true

Open this example in the interactive library
import {
URL,
domainToASCII,
domainToUnicode,
pathToFileURL,
fileURLToPath,
} from "node:url";
console.log(URL.canParse("/help", "https://example.org"));
true