serverless/lib/utils/fs/fileExists.js
2021-01-04 16:21:24 +01:00

13 lines
209 B
JavaScript

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