13 lines
190 B
JavaScript
13 lines
190 B
JavaScript
|
const fs = require('fs/promises')
|
||
|
|
||
|
async function fileExists (filename) {
|
||
|
try {
|
||
|
await fs.stat(filename)
|
||
|
return true
|
||
|
} catch {
|
||
|
return false
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = fileExists
|