mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
18 lines
297 B
JavaScript
18 lines
297 B
JavaScript
'use strict';
|
|
|
|
const fsp = require('fs').promises;
|
|
|
|
async function dirExists(path) {
|
|
return fsp.lstat(path).then(
|
|
(stats) => stats.isDirectory(),
|
|
(error) => {
|
|
if (error.code === 'ENOENT') {
|
|
return false;
|
|
}
|
|
throw error;
|
|
}
|
|
);
|
|
}
|
|
|
|
module.exports = dirExists;
|