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

18 lines
294 B
JavaScript

'use strict';
const fse = require('fs-extra');
async function dirExists(path) {
return fse.lstat(path).then(
(stats) => stats.isDirectory(),
(error) => {
if (error.code === 'ENOENT') {
return false;
}
throw error;
}
);
}
module.exports = dirExists;