Bun Convert a file URL to an absolute path

Convert a file URL to an absolute path

jarle Updated

File contents

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 Docs > API > Utils for more useful utilities.

jarle/bun-skills/tree/main/skills/bun-guides-util-file-url-to-path commit 84c6b872d6

Frequently asked questions

npx skillmds@latest add jarle/bun-convert-a-file-url-to-an-absolute-path