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

17 lines
331 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](/runtime/utils) for more useful utilities.