Bun Convert an absolute path to a file URL

Convert an absolute path to a file URL

jarle Updated

File contents

Convert an absolute path to a file URL

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

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

See Docs > API > Utils for more useful utilities.

jarle/bun-skills/tree/main/skills/bun-guides-util-path-to-file-url commit 973f143ada

Frequently asked questions

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