mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 17:45:34 -05:00
15 lines
246 B
JavaScript
15 lines
246 B
JavaScript
|
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
|