code: function prepareEPUBDataForIndexing(metaData) {
  
      if (!metaData.spineItems.length)
          return;
  
      var data = [];
  
      const arrayOfPromises = metaData.spineItems.map(spineItem => {
          return helper.getContent(spineItem.href)
              .then(body => { return cheerio.load(body); })
      });
  
      return Promise.all(arrayOfPromises)
          .then((arrayOf$) => {
  
              arrayOf$.forEach(($, i) => {
                  const doc = {};
                  $("title").each((i, e) => {
                      doc.title = trim($(e).text());
                  });
                  $("body").each((i, e) => {
                      doc.body = trim($(e).text());
                  });
                  setMetaData(doc, metaData, metaData.spineItems[i]);
                  data.push(doc);
              });
              return data;
          })
          .catch(err => {
              winston.log('error', 'prepareEPUBDataForIndexing: ' + err);
          });
  }
docs: ************
  private
  ***********