I have a function in my nodejs application called get_source_at. It takes a uri as an argument and its purpose is to return the source code from that uri. My problem is that
You can with deasync:
function get_source_at(uri){ var source; request({ uri:uri}, function (error, response, body) { source = body; console.log(body); }); while(source === undefined) { require('deasync').runLoopOnce(); } return source; }