aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/util/file-url-to-path.md
blob: 0464504a69e3bdc1bb417d175290b41f1b832605 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
name: Convert a file URL to an absolute path
---

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