Skip to main content
Bun.file() 函数接受一个路径并返回一个 BunFile 实例。使用 .delete() 方法来删除该文件。
const path = "/path/to/file.txt";
const file = Bun.file(path);

await file.delete();

完整的 Bun.file() 文档请参见 文档 > API > 文件 I/O