Skip to content

Instantly share code, notes, and snippets.

@passcod
Created April 4, 2013 22:11
Show Gist options
  • Select an option

  • Save passcod/5314843 to your computer and use it in GitHub Desktop.

Select an option

Save passcod/5314843 to your computer and use it in GitHub Desktop.
var require('request');
var processFoo = function(arg) {
// do something
};
request('http://example.com', function(error, body, response) {
processFoo(response);
});
// or:
var out;
console.log(out); //=> undefined
request('http://example.com', function(error, body, response) {
out = response;
console.log(out); //=> the response object
});
console.log(out); //=> undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment