I'm having some troubles using a nodejs function. All i want to do is get the return value. When i look at my consolelog, i can see 'Undefined'.
I know that this is because callbacks does not end before console.log is executed but i dont have a clue that how to resolve this problem.
var info = api.getBridge();
console.log(info)
api.getBridge = function () {
var hue = require("node-hue-api");
var resultado;
hue.nupnpSearch(function (err, result) {
if (err) throw err;
return result;
});
}