Files
2026-08-27 21:09:14 +00:00

19 lines
354 B
Plaintext

---
title: Delete a file
sidebarTitle: Delete file
mode: center
---
The `Bun.file()` function accepts a path and returns a `BunFile` instance. Use the `.delete()` method to delete the file.
```ts
const path = "/path/to/file.txt";
const file = Bun.file(path);
await file.delete();
```
---
See [`Bun.file()`](/runtime/file-io#reading-files-bun-file).