FfileURLToPathBuffer
Bun

function

url.fileURLToPathBuffer

url: string | URL,
): Buffer;

Like url.fileURLToPath(...) except that instead of returning a string representation of the path, a Buffer is returned. This conversion is helpful when the input URL contains percent-encoded segments that are not valid UTF-8 / Unicode sequences.

@param url

The file URL string or URL object to convert to a path.

@returns

The fully-resolved platform-specific Node.js file path as a Buffer.