aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/util/file-url-to-path.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/guides/util/file-url-to-path.md')
-rw-r--r--docs/guides/util/file-url-to-path.md14
1 files changed, 14 insertions, 0 deletions
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.