# Bun Convert an absolute path to a file URL

> Convert an absolute path to a file URL

- Skill: `jarle/bun-convert-an-absolute-path-to-a-file-url` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jarle/bun-convert-an-absolute-path-to-a-file-url`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jarle/bun-convert-an-absolute-path-to-a-file-url/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jarle (https://skillmd.com/u/jarle)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/jarle/bun-convert-an-absolute-path-to-a-file-url

---


# Convert an absolute path to a file URL

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

```ts  theme={"theme":{"light":"github-light","dark":"dracula"}}
Bun.pathToFileURL("/path/to/file.txt");
// => "file:///path/to/file.txt"
```

***

See [Docs > API > Utils](/runtime/utils) for more useful utilities.

