Runtime
Bundler
Package Manager
Test Runner
Guides
Reference
Blog
Install Bun
Guides Utilities

Convert a file URL to an absolute path

Use Bun.fileURLToPath() to convert a file:// URL to an absolute path.

Bun.fileURLToPath("file:///path/to/file.txt");
// => "/path/to/file.txt"

See Utils.

On this page

No Headings