UNPKG

@utopia-utils/cli

Version:
17 lines (15 loc) 360 B
import { access } from 'node:fs/promises' /** * It returns true if the path exists, and false if it doesn't * @param {string} path - The path to check. * @returns A promise that resolves to a boolean. */ export async function pathExists(path: string): Promise<boolean> { try { await access(path) return true } catch { return false } }