title: What download images from remote url
body: <p>I've array of url images. I need download asynchronous this images from remote url to my server.</p>
  
  <p>EXAMPLE:</p>
  
  <pre><code>// i need this function return array localfiles after download 
  
  function someFunctionAsDownloadedRemoteIMages(arrayOfRemoteUrls){
      localImages = [];
      arrayOfRemoteUrls.forEach(function(url){
          request.head(url, function(err, res, body){
              newImageName = randomInt(100000, 999999);
              var filename = 'catalog/import/'+newImageName+'.jpg';
  
              request(url, {encoding: 'binary'}, function(error, response, body) {
                fs.writeFile('image/'+filename, body, 'binary', function (err) {
                  if(err)
                      return;
                  localImages.push(filename);
                });
              });
          });
      });
  }
  
  var remoteImagesArray = ["http://example.com/1.jpg", "http://example.com/1444.jpg","http://example.com/ddsgggg.jpg"]; 
  
  localImagesArray = someFunctionAsDownloadedRemoteIMages(remoteImagesArray); 
  
  someFunctionProccess(localImagesArray); 
  </code></pre>