Skip to content

La fonction Bun.file() accepte un chemin et retourne une instance BunFile. Utilisez la méthode .exists() pour vérifier si un fichier existe au chemin donné.

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

await file.exists(); // boolean;

Consultez API > E/S de fichiers pour plus d'informations sur l'utilisation de BunFile.

Bun édité par www.bunjs.com.cn