Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 354 Bytes

File metadata and controls

18 lines (13 loc) · 354 Bytes
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.

const path = "/path/to/file.txt";
const file = Bun.file(path);

await file.delete();

See Bun.file().