UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

15 lines (13 loc) 271 B
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; } }