2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-27 07:33:47 +00:00
nativefier/src/helpers/fsHelpers.ts

20 lines
376 B
TypeScript
Raw Normal View History

import * as fs from 'fs';
export function dirExists(dirName: string): boolean {
try {
const dirStat = fs.statSync(dirName);
return dirStat.isDirectory();
} catch {
return false;
}
}
export function fileExists(fileName: string): boolean {
try {
const fileStat = fs.statSync(fileName);
return fileStat.isFile();
} catch {
return false;
}
}