温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/url/fileURLToPathBuffer
点击访问原文链接

Node url.fileURLToPathBuffer function | API Reference | Bun

Node url.fileURLToPathBuffer function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:url/fileURLToPathBufferFfileURLToPathBuffer

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:url/fileURLToPathBufferFfileURLToPathBuffer

function

url.fileURLToPathBufferfunction fileURLToPathBuffer(url: string | URL,options?: FileUrlToPathOptions): 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.

Security Considerations:

This function has the same security considerations as url.fileURLToPath(). It decodes percent-encoded characters, including encoded dot-segments (%2e as . and %2e%2e as ..), and normalizes the path. Applications must not rely on this function alone to prevent directory traversal attacks. Always perform explicit path validation on the returned buffer value before using it for file system operations.

@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 typesinterface URLhash: stringhost: stringhostname: stringhref: stringreadonly origin: stringpassword: stringpathname: stringport: stringprotocol: stringsearch: stringreadonly searchParams: URLSearchParamsusername: stringtoJSON(): string;interface FileUrlToPathOptionswindows?: boolean

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

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node url.fileURLToPathBuffer function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for function node:url.fileURLToPathBuffer | Bun