Convert a URL to a filesystem path.
function
fileURLToPath
@param url
The URL to convert.
@returns
A filesystem path.
const path = Bun.fileURLToPath(new URL("file:///foo/bar.txt"));
console.log(path); // "/foo/bar.txt"
Referenced types
class URL
The URL interface represents an object providing static methods used for creating object URLs.
The
toString()
method on theURL
object returns the serialized URL. The value returned is equivalent to that of href and toJSON.