title: Copying large amount of files with nodejs?
body: <p>I have to copy a large amount of files (like 25000) asynchronously. I'm using this library: <a href="https://github.com/stephenmathieson/node-cp" rel="nofollow">https://github.com/stephenmathieson/node-cp</a>. </p>
  
  <p>This is my code:</p>
  
  <pre><code>         for(var i = 0; i &lt; 25000; i++){
              cp(origin[i], dest[i], function(err){
                console.log("successfully copied")
              })
           }
  </code></pre>
  
  <p>It completes the loop but it doens't copy every item. The "Successfully copied" is called between 6000 and 8000 times. After that it doesn't copy anymore. It has something to do with the memory or a limit for async tasks? </p>
  
  <p>Any help would be appreciated!</p>