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 a file URL to an absolute path
|
|
sidebarTitle: File URL to path
|
|
mode: center
|
|
---
|
|
|
|
Use `Bun.fileURLToPath()` to convert a `file://` URL to an absolute path.
|
|
|
|
```ts
|
|
Bun.fileURLToPath("file:///path/to/file.txt");
|
|
// => "/path/to/file.txt"
|
|
```
|
|
|
|
---
|
|
|
|
See [Docs > API > Utils](https://bun.com/docs/api/utils) for more useful utilities.
|