title: How to throttle Promise.all() to 5 promises per second?
body: <p>I have a couple of items that I need to query a 3rd party API for and said API has a call limit of 5 calls per second. I need to somehow throttle my calls to the API to a maximum of 5 calls per second.</p>
  
  <p>So far I've just used <code>Promise.all()</code> on an array of promises, where each promise sends a request to the API and resolves when the API responds with the HTTP status code <code>200</code> and rejects when it responds with some other status code. However, when I have more than 5 items in the array, I risk that the <code>Promise.all()</code> rejects.</p>
  
  <p>How can I limit the <code>Promise.all()</code> call to 5 calls per second?</p>