UNPKG

@denodnt/logger

Version:

deno logger available for deno and NPM

20 lines (19 loc) 455 B
import * as dntShim from "./_dnt.shims.js"; const { lstat } = dntShim.Deno; /** * Async existance check for file return true if file exists * @param filePath path to file * @returns Promise<boolean> */ export async function exists(filePath) { try { await lstat(filePath); return true; } catch (err) { if (err instanceof dntShim.Deno.errors.NotFound) { return false; } throw err; } }