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/file-url-to-path.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/guides/util/file-url-to-path.md (limited to 'docs/guides/util/file-url-to-path.md') diff --git a/docs/guides/util/file-url-to-path.md b/docs/guides/util/file-url-to-path.md new file mode 100644 index 000000000..0464504a6 --- /dev/null +++ b/docs/guides/util/file-url-to-path.md @@ -0,0 +1,14 @@ +--- +name: Convert a file URL to an absolute path +--- + +Use `Bun.fileURLToPath()` to convert a `file://` URL to an absolute path. + +```ts +Bun.fileURLToPath("file:///path/to/file.txt"); +// => "/path/to/file.txt" +``` + +--- + +See [Docs > API > Utils](/docs/api/utils) for more useful utilities. -- cgit v1.2.3