import * as fs from 'fs/promises'; export async function exists(file) { try { return await fs.stat(file); } catch(err) { return false; } }