title: using Promise.all with easyPost API for multiple requests for tracking status
body: <p>I need to output a long list of shipments and their tracking Status/ tracking <code>URL</code>.</p>
  
  <p>If I was running this synchronously then it may well take a very long time. So if I run it asynchronously it should be quicker as all the requests will run at the same time, then return all the information to the frontend when it's all done.</p>
  
  <p>So I'm still learning in node and using promises, however I have got this so far... but the problem is that the Promise.all never seems to execute. So I'm not sure if I'm doing the Promise function correctly or is it something I don't know about the <code>easyPost API</code>?</p>
  
  <p>yes for now I'm just using 2 shipment Id's but it could run to 100's or more... </p>
  
  <p>also is there a way of returning a tracker element when retrieving a shipment, so that I don't have to do 2 calls for each shipment?</p>
  
  <pre><code>var promise = []
  promise.push(getShipmentPromise('shp_xxxShipmentId'))
  promise.push(getShipmentPromise('shp_xxxShipmentId2'))
  Promise.all(promise)
     .then(response =&gt; {
        console.log('Sent - ' + req.method + req.originalUrl)
        console.log('promise.all complete.')
        // within an expressjs route
        res.json(batches)
     })
     .catch(err =&gt; {
        console.log(err)
     })        
  
      function getShipmentPromise (shipmentId) {
        return new Promise((resolve, reject) =&gt; {
          easyPostAPI.Shipment.retrieve(shipmentId).then(response =&gt; {
            console.log(response.created_at)
          })
        })
      }
  </code></pre>