FfileURLToPathBuffer
Bun

function

url.fileURLToPathBuffer

url: string | URL,
): NonSharedBuffer;

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.

Referenced types

interface URL

interface FileUrlToPathOptions

  • windows?: boolean

    true if the path should be return as a windows filepath, false for posix, and undefined for the system default.