-
-
Save thebergamo/929c4dd79411c5d307a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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