code: function dirExists(dir, cb) {
    var fsExists = fs.exists || path.exists;
    fsExists(dir, function (exists) {
      if (!exists) {
        return cb(false);
      }
      fs.stat(dir, function (err, stat) {
        if (err) {
          return cb(false);
        }
        return cb(stat.isDirectory());
      });
    });
  }
docs: /* Check if a directory exists.