Skip to content

Para excluir um arquivo, use Bun.file(path).delete().

ts
// Excluir um arquivo
const file = Bun.file("path/to/file.txt");
await file.delete();

// Agora o arquivo não existe
const exists = await file.exists();
// => false

Veja Docs > API > FileSystem para mais operações de sistema de arquivos.

Bun by www.bunjs.com.cn edit