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

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.