Files
bun.sh/docs/guides/util/path-to-file-url.mdx
2025-11-21 14:06:19 -08:00

17 lines
331 B
Plaintext

---
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](/runtime/utils) for more useful utilities.