code: function promiseAllP(items, block) {
      var promises = [];
      items.forEach(function(item,index) {
          promises.push( function(item,i) {
              return new Promise(function(resolve, reject) {
                  return block.apply(this,[item,index,resolve,reject]);
              });
          }(item,index))
      });
      return Promise.all(promises);
  }
docs: https://stackoverflow.com/questions/10049557/reading-all-files-in-a-directory-store-them-in-objects-and-send-the-object