serverless/lib/utils/fs/file-exists.js
2022-01-27 15:21:58 +01:00

13 lines
218 B
JavaScript

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