title: Node.js - want 5 parallel calls to a method in a loop
body: <p>I have 1000 files of information in MongoDB collection. I am writing a query to fetch 1000 records and in a loop, I am calling a function to download that file to local system. So, it's a sequential process to download all 1000 files. </p>
  
  <p>I want some parallelism in the downloading process. In the loop, I want to download 10 files at a time, meaning I want to call download function 10 times, after completing 10 file downloads I want to download next 10 files (that means I need to call download function 10 times).</p>
  
  <p>How can I achieve this parallelism OR is there any better way to do this?</p>
  
  <p>I saw <code>Kue</code> npm, but how to achieve this? By the way I am downloading from FTP, so I am using <code>basic-ftp</code> npm for ftp operations.</p>