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.

Traducción © 2026 fanyi.dev · Original © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)