Skip to content

Instantly share code, notes, and snippets.

@Trindaz
Created March 28, 2012 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trindaz/2230431 to your computer and use it in GitHub Desktop.
Save Trindaz/2230431 to your computer and use it in GitHub Desktop.
//synchronous behaviour testing
var async = require('async');
var request = require('request');
function async_function(){
}
function sync_function(){
var result = "5";
async.series([
function(callback){
request(
{uri:"http://www.craigslist.com"},
function (error, response, body) {
callback(null, body)
});
}
],
function(err, results){
console.log('The call to series has completed... Here is the result:');
console.log(results);
this.result = results;
});
return result;
}
//console.log('hello world');
console.log(sync_function());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment