Bun.file() 関数はパスを受け入れ、BunFile インスタンスを返します。.delete() メソッドを使用してファイルを削除します。
ts
const path = "/path/to/file.txt";
const file = Bun.file(path);
await file.delete();Bun.file() の完全なドキュメントについては、ドキュメント > API > ファイル I/O を参照してください。