diff --git a/src/filesystem.ts b/src/filesystem.ts index a6773a7..9bc1605 100644 --- a/src/filesystem.ts +++ b/src/filesystem.ts @@ -33,6 +33,10 @@ export interface ReadJsonAsync { } export function fileExistsSync(path: string): boolean { + // If the file doesn't exist, avoid throwing an exception over the native barrier for every miss + if (!fs.existsSync(path)) { + return false; + } try { const stats = fs.statSync(path); return stats.isFile();