Skip to main content
Module

x/deno_context_finder/helpers.ts

Extract context blocks from a configuration file
Latest
File
export const fileExists = async (filename: string): Promise<boolean> => { try { await Deno.stat(filename); // successful, file or directory must exist return true; } catch (error) { if (error instanceof Deno.errors.NotFound) { // file or directory does not exist return false; } else { // unexpected error, maybe permissions, pass it along throw error; } }};