flame/utils/checkFileExists.js

11 lines
206 B
JavaScript
Raw Permalink Normal View History

2021-10-21 15:14:25 +00:00
const fs = require('fs');
const checkFileExists = (path) => {
return fs.promises
.access(path, fs.constants.F_OK)
.then(() => true)
.catch(() => false);
};
module.exports = checkFileExists;