isDirectory = dirPath => {
  try {
    return fs.existsSync(dirPath) && fs.lstatSync(dirPath).isDirectory()
  } catch (_) {
    return false
  }
}
Returns true if the path is a directory with read access.

@param {string} dirPath The directory path.