I realize JavaScript callbacks have been explained over and over, but I don't seem to find a way to save values from an inner callback function.
request.get('http://google.com', function(error, response, body){
var $ = cheerio.load(body);
// Process HTML here
// How do I save the result from processing with a callback
}
// Or
var parse = function(error, response, body){
// Process HTML here
// Assign result to a variable or pass a callback to this function
};
request.get('http://google.com', parse);
I have multiple urls to process and I'd like to have one object summarizing the information afterwards.
By saving I mean either assigning to a variable or saving to a file.