mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
17 lines
347 B
Plaintext
17 lines
347 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](https://bun.com/docs/api/utils) for more useful utilities.
|