mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
382 B
382 B
name
| name |
|---|
| Delete a file |
The Bun.file() function accepts a path and returns a BunFile instance. Use the .delete() method to delete the file.
const path = "/path/to/file.txt";
const file = Bun.file(path);
await file.delete();
See Docs > API > File I/O for complete documentation of Bun.file().