mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
18 lines
288 B
JavaScript
18 lines
288 B
JavaScript
'use strict';
|
|
|
|
const fse = require('fs-extra');
|
|
|
|
function dirExists(path) {
|
|
return fse.lstat(path).then(
|
|
(stats) => stats.isDirectory(),
|
|
(error) => {
|
|
if (error.code === 'ENOENT') {
|
|
return false;
|
|
}
|
|
throw error;
|
|
}
|
|
);
|
|
}
|
|
|
|
module.exports = dirExists;
|