chipmunkbot3/util/file_exists.js

13 lines
190 B
JavaScript
Raw Normal View History

2024-04-04 21:44:45 -04:00
const fs = require('fs/promises')
async function fileExists (filename) {
try {
await fs.stat(filename)
return true
} catch {
return false
}
}
module.exports = fileExists