15 lines
351 B
JavaScript
15 lines
351 B
JavaScript
const fs = require('fs');
|
|
|
|
async function existsAsync(filePath) {
|
|
return new Promise(function (resolve, _reject) {
|
|
fs.stat(filePath, function (err, _stat) {
|
|
if (err == null) {
|
|
resolve(true)
|
|
} else {
|
|
resolve(false);
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
module.exports = { existsAsync }; |