Skip to content

Instantly share code, notes, and snippets.

@thebergamo
Forked from paulohp/mundo.js
Last active August 29, 2015 14:06
Show Gist options
  • Save thebergamo/929c4dd79411c5d307a2 to your computer and use it in GitHub Desktop.
Save thebergamo/929c4dd79411c5d307a2 to your computer and use it in GitHub Desktop.
// module
exports.makePaulo = function (cb) {
var ret = {valid: false, data = ''};
request('http://blaablablablbla', function(err, res, body){
ret.valid = true;
return ret;
});
};
//using module
var mundo = require('mundo');
var paulo = mundo.makePaulo();
if(paulo.valid)
console.log(paulo.data); //should be a statusCode like 200 but I got undefined
else
console.log('No data yet!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment