flame/utils/checkFileExists.js
2021-10-21 17:14:25 +02:00

11 lines
206 B
JavaScript

const fs = require('fs');
const checkFileExists = (path) => {
return fs.promises
.access(path, fs.constants.F_OK)
.then(() => true)
.catch(() => false);
};
module.exports = checkFileExists;