title: Wait an event to resolve a promise
body: <p>I am using a node.js module that has a method without callbacks. Instead of it, has an event that fires when that method has finished. I want resolve a promise, using that event as callback securing me that method has been completed succesfully. </p>
  
  <p>array.lenght on promise can be X. So, I need 'hear' X times the event to secure me that all methods has completed succesfully &lt;-- <strong>This is not the problem, I am just telling you that I know this could happen</strong></p>
  
  <p><strong>Event :</strong></p>
  
  <pre><code>tf2.on('craftingComplete', function(recipe, itemsGained){
    if(recipe == -1){
    console.log('CRAFT FAILED')
    }
    else{
          countOfCraft++;
      console.log('Craft completed! Got a new Item  #'+itemsGained);
    }
  })
  </code></pre>
  
  <p><strong>Promise:</strong></p>
  
  <pre><code>const craftWepsByClass = function(array, heroClass){
          return new Promise(function (resolve, reject){
  
              if(array.length &lt; 2){
                  console.log('Done crafting weps of '+heroClass);
                  return resolve();
              }
              else{
                  for (var i = 0; i &lt; array.length; i+=2) {
                      tf2.craft([array[i].id, array[i+1].id]); // &lt;--- this is the module method witouth callback
                  }
          return resolve(); // &lt;---- I want resolve this, when all tf2.craft() has been completed. I need 'hear' event many times as array.length
              }   
  
          })
  }
  </code></pre>