I have to copy a large amount of files (like 25000) asynchronously. I'm using this library: https://github.com/stephenmathieson/node-cp.
This is my code:
for(var i = 0; i < 25000; i++){
cp(origin[i], dest[i], function(err){
console.log("successfully copied")
})
}
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?
Any help would be appreciated!