lib/dirs-exist.js
function stupidDirsExist(dirs) {
  const check = [];
  dirs.forEach((dir) => {
    check.push(dirExist(dir));
  });

  return Promise.all(check).then((results) => {
    // Combine to single object
    return dirs.reduce(function(prev, item, i) {
      prev[item] = !!results[i];

      return prev;
    }, {});
  });
}
function stupidDirsExist(dirs) {
  const check = [];
  dirs.forEach((dir) => {
    check.push(dirExist(dir));
  });

  return Promise.all(check).then((results) => {
    // Combine to single object
    return dirs.reduce(function(prev, item, i) {
      prev[item] = !!results[i];

      return prev;
    }, {});
  });
}
function stupidDirsExist ( dirs ) { const check = [ ] ; dirs . forEach ( ( dir ) => { check . push ( dirExist ( dir ) ) ; } ) ; return Promise . all ( check ) . then ( ( results ) => { // Combine to single object return dirs . reduce ( function ( prev , item , i ) { prev [ item ] = ! ! results [ i ] ; return prev ; } , { } ) ; } ) ; }
Check if dirs exist, all at once
@param {Array} dirs
@return {Promise} {dir: exist}
Check if dirs exist all at once