serverless/lib/utils/fs/fileExists.js
2021-08-06 12:40:23 +02:00

13 lines
215 B
JavaScript

'use strict';
const fse = require('fs-extra');
async function fileExists(filePath) {
return fse
.lstat(filePath)
.then((stats) => stats.isFile())
.catch(() => false);
}
module.exports = fileExists;