Open this example in the interactive library
Source code
import {
URL,
domainToASCII,
domainToUnicode,
pathToFileURL,
fileURLToPath,
} from "node:url";
console.log(fileURLToPath("file:///tmp/report%20one.txt", { windows: false }));
Sample output
/tmp/report one.txt
