title: Multiple child_process exec on node js
body: <p>I am trying to get data using curl on nodejs. I need to run more than one child_process for each query in order to retrieve the data without delays.</p>
  
  <pre><code>router.post('/curl/', function* () {
  
        var urls = this.request.body.url;
        var exec = require('child_process').exec;
  
        var promise = new Promise((resolve, reject) =&gt; {
  
                  var count = urls.length;
  
                  var res = _.map(urls, (stream) =&gt; {
                       // stream = {url:'http://url1.com'};
  
                       var command = 'curl '+stream.url+';
  
                       exec(command, (error, stdout, stderr) =&gt; {
                            if (error !== null) {
                                console.log('exec error: ' + error);
                            }
                            return stdout;
                       });
                  });
  
                  resolve(res);
       });
  
        this.body = yield promise;
   });
  </code></pre>
  
  <p>This resolve '[null, null]';
  I was tried to use Promise.map, but it was failed too.</p>
  
  <p>If I make a single request (without _.map()) - it returns HTML of the requested page, as I expect.
  How to run more than one child_process for my requests?</p>