12 lines
190 B
JavaScript
12 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
|