flame/utils/checkFileExists.js

11 lines
206 B
JavaScript
Raw Normal View History

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