mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
16 lines
278 B
JavaScript
16 lines
278 B
JavaScript
import { promises as fsp } from 'fs'
|
|
|
|
async function dirExists(path) {
|
|
return fsp.lstat(path).then(
|
|
(stats) => stats.isDirectory(),
|
|
(error) => {
|
|
if (error.code === 'ENOENT') {
|
|
return false
|
|
}
|
|
throw error
|
|
},
|
|
)
|
|
}
|
|
|
|
export default dirExists
|