mirror of
https://github.com/oven-sh/bun
synced 2026-02-18 23:01:58 +00:00
15 lines
302 B
Markdown
15 lines
302 B
Markdown
---
|
|
name: Convert an absolute path to a file URL
|
|
---
|
|
|
|
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.
|