serverless/lib/utils/fs/file-exists.js
2024-05-29 11:51:04 -04:00

11 lines
200 B
JavaScript

import { promises as fsp } from 'fs'
async function fileExists(filePath) {
return fsp
.lstat(filePath)
.then((stats) => stats.isFile())
.catch(() => false)
}
export default fileExists