10 lines
206 B
JavaScript
10 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;
|