diff options
Diffstat (limited to 'docs/guides/util/path-to-file-url.md')
-rw-r--r-- | docs/guides/util/path-to-file-url.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/guides/util/path-to-file-url.md b/docs/guides/util/path-to-file-url.md new file mode 100644 index 000000000..202be61eb --- /dev/null +++ b/docs/guides/util/path-to-file-url.md @@ -0,0 +1,14 @@ +--- +name: Convert an absolute path to a file URL +--- + +Use `Bun.pathToFileURL()` to convert an absolute path to a `file://` URL. + +```ts +Bun.pathToFileURL("/path/to/file.txt"); +// => "file:///path/to/file.txt" +``` + +--- + +See [Docs > API > Utils](/docs/api/utils) for more useful utilities. |