Skip to main content

Documentation Index

Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt

Use this file to discover all available pages before exploring further.

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

await file.delete();

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