From 4c89c60867591b50e0b31bf5009fd5ad6a3cebe1 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Wed, 26 Jul 2023 14:59:39 -0700 Subject: Add files (#3826) --- docs/guides/util/path-to-file-url.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/guides/util/path-to-file-url.md (limited to 'docs/guides/util/path-to-file-url.md') 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. -- cgit v1.2.3