Skip to main content

Convert an absolute path to a file URL

还没翻译译自英文(bun.com)本页 3 段都还没译

Use Bun.pathToFileURL() to convert an absolute path to a file:// URL.

Bun.pathToFileURL("/path/to/file.txt").href;
// => "file:///path/to/file.txt"

See Utils.

번역 © 2026 fanyi.dev · 원문 © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)