Try this, should work. You may want to try mapLimit to limit the no of parallel requests or mapSeries to do it in order.
var async = require('async');
var request = require('request');
async.map(['url1', 'url2'], function(item, callback){
request(item, function (error, response, body) {
callback(error, body);
});
}, function(err, results){
console.log(results);
});
for your example I need to see your get_options function. is it synchronous? if yes you can do this
var async = require('async');
var request = require('request');
var options;
async.map([item1, item2], function(item, callback){
options = get_options(item);
request(options, function (error, response, body) {
callback(error, body);
});
}, function(err, results){
console.log(results);
});
If your get_options is asynchronous and accepts callback do following:
var async = require('async');
var request = require('request');
async.map([item1, item2], function(item, callback){
get_options(item, function(err, option){
if(err) {
callback(err);
}
else{
request(options, function (error, response, body) {
callback(error, body);
});
}
});
}, function(err, results){
console.log(results);
});