Convert a filesystem path to a file:// URL.
Symbol
pathToFileURL
@param path
The path to convert.
@returns
A URL with the file:// scheme.
const url = Bun.pathToFileURL("/foo/bar.txt");
console.log(url.href); // "file:///foo/bar.txt"
Internally, this function uses WebKit's URL API to convert the path to a file:// URL.
Referenced types
class URL
The URL interface represents an object providing static methods used for creating object URLs.