1
0
Fork 0
mirror of https://github.com/ChomeNS/chomens-bot-mc.git synced 2025-07-25 13:18:45 -04:00
chomens-bot-js/util/file-exists.js

15 lines
246 B
JavaScript
Raw Normal View History

2022-08-14 16:51:45 +07:00
const fs = require('fs/promises')
async function fileExists (filepath) {
try {
await fs.access(filepath)
return true
} catch (error) {
if (error.code !== 'ENOENT') throw error
return false
}
}
module.exports = fileExists