title: .each and callbacks
body: <p>I am using request and cheerio node modules to create get some data out of a website.
  I'd like to get a list of item and once this list is complete, call an asynchronous function:</p>
  
  <pre><code>request('http://myurl', function(req,res,data){
      var $ = cheerio.load(data);
      var List = [];
  
      $('.myItems').each(function(i, element){
          console.log( typeof $(this).text() )
          List.push($(this).text());
      });
  
     for (var i=0; i &lt;  List.length; i++){
        // make an asynchronous call to a API
     }
  });
  </code></pre>
  
  <p>My question is how do I wait for the list to be completed, ie, how can I know than the .each function has looped through all the items?</p>
  
  <p>Can I do this with async?</p>
  
  <p>Thanks</p>