title: async and Q promises in nodejs
body: <p>I'm using the <a href="https://github.com/kriskowal/q" rel="nofollow">Q</a> library and <a href="https://github.com/caolan/async" rel="nofollow">async</a> library in nodejs.</p>
  
  <p>Here's an example of my code:</p>
  
  <pre><code>async.each(items, cb, function(item) {
  
   saveItem.then(function(doc) {
      cb();
   });
  
  }, function() {
  
  });
  </code></pre>
  
  <p><code>saveItem</code> is a promise.  When I run this, I always get <code>cb is undefined</code>, I guess <code>then()</code> doesn't have access.  Any ideas how to work around this?</p>