Skip to content

A função Bun.file() aceita um caminho e retorna uma instância BunFile. Use o método .exists() para verificar se um arquivo existe no caminho fornecido.

ts
const path = "/path/to/package.json";
const file = Bun.file(path);

await file.exists(); // boolean;

Consulte API > File I/O para mais informações sobre trabalhar com BunFile.

Bun by www.bunjs.com.cn edit