Bun.file() 函數接受一個路徑並返回一個 BunFile 實例。使用 .delete() 方法刪除文件。
ts
const path = "/path/to/file.txt";
const file = Bun.file(path);
await file.delete();請參閱 文檔 > API > File I/O 獲取 Bun.file() 的完整文檔。