Open this example in the interactive library
Source code
import {
URL,
domainToASCII,
domainToUnicode,
pathToFileURL,
fileURLToPath,
} from "node:url";
console.log(domainToUnicode("xn--caf-dma.example"));
Sample output
café.example

Open this example in the interactive library
import {
URL,
domainToASCII,
domainToUnicode,
pathToFileURL,
fileURLToPath,
} from "node:url";
console.log(domainToUnicode("xn--caf-dma.example"));
café.example