serverless/lib/utils/fs/dirExists.js

18 lines
286 B
JavaScript

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