I assume you're trying to make a synchronous call from a node.js script, then when it finishes, do other things as well.
If your other scripts are also node.js, you would probably add a `callback` parameter to your _call method, and call it when done.
Example:
function _call(cb) {
request.get(someUrl, function(err, response) {
// handle err if any
if(err) {return cb(err);}
// do stuff with body, i.e. your JSON.parse
// then call the callback
cb(null, response.body);
});
});
// then export the function
module.exports.call = _call;
You would call this as follows, from other modules:
var myModule = require('./linode-module.js');
// when you call the module, pass it a function that will be executed when done. That is where you get the results.
myModule.call(function(err, body) {
// this function will receive your response.
console.log(body);
// now you can do other useful things with it.
});
Hope that helps.
Zlatko