title: Why async.map function works with the native fs.stat function?
body: <pre><code>async.map(['file1','file2','file3'], fs.stat, function(err, results){
      // results is now an array of stats for each file
  });
  </code></pre>
  
  <p>As per <a href="https://github.com/caolan/async#maparr-iterator-callback" rel="nofollow">documentation</a>, the second argument is:</p>
  
  <blockquote>
    <p>iterator(item, callback) - A function to apply to each item in the
    array.</p>
  </blockquote>
  
  <p>Fine.</p>
  
  <blockquote>
    <p>The iterator is passed a callback(err, transformed) which must
    be called once it has completed with an error (which can be null) and
    a transformed item.</p>
  </blockquote>
  
  <p>I think that<code>fs.stat</code> does not conform to this and  I would say that this shouldn't work.</p>
  
  <p>It should be something like:</p>
  
  <pre><code>async.map(['file1','file2','file3'],
      function (file, complete) {
          fs.stat(file, function (err, stat) {
              complete(err, stat)
          });
      }, function(err, results){
          // results is now an array of stats for each file
      }
  );
  </code></pre>