Skip to main content

Delete files

还没翻译译自英文(bun.com)本页 3 段都还没译

To delete a file, use Bun.file(path).delete().

// Delete a file
const file = Bun.file("path/to/file.txt");
await file.delete();

// Now the file doesn't exist
const exists = await file.exists();
// => false

See File I/O for more filesystem operations.

번역 © 2026 fanyi.dev · 원문 © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)