import { access } from 'fs'; import { promisify } from 'util'; export async function exists(path: string) { if (!path) { throw new Error('path is mandatory'); } try { await promisify(access)(path); return true; } catch (ex) { return false; } }