UNPKG

bun-types

Version:

Type definitions and documentation for Bun, an incredibly fast JavaScript runtime

17 lines (12 loc) 336 B
--- title: Convert an absolute path to a file URL sidebarTitle: Path to file URL mode: center --- Use `Bun.pathToFileURL()` to convert an absolute path to a `file://` URL. ```ts Bun.pathToFileURL("/path/to/file.txt"); // => "file:///path/to/file.txt" ``` --- See [Docs > API > Utils](/docs/runtime/utils) for more useful utilities.