刪除檔案
Bun.file() 函式接受一個路徑並傳回一個 BunFile 例項。使用 .delete() 方法來刪除該檔案。
TypeScript
const path = "/path/to/file.txt";
const file = Bun.file(path);
await file.delete();
請參閱 Bun.file()。
Bun.file() 函式接受一個路徑並傳回一個 BunFile 例項。使用 .delete() 方法來刪除該檔案。
const path = "/path/to/file.txt";
const file = Bun.file(path);
await file.delete();
請參閱 Bun.file()。