music.playsong = function(vars){
//vars is an array with a Key named "song"
youTube.search(vars["song"], 2, function(error, result) {
if (error) {
console.log(error)
return;
}else {
console.log("Success")
return result
}
})
}
I am currently calling this function as
music.playsong(data)
However in this function I can not access the underlying callback and get the value from that. How do I get this music.playsong() to return the result of the callback without blocking execution?