I have a call to a externa function getUsers. This function perform a request to an API and based on the retrieved info must return a value that has to be readable by the original function caller:
Original call
library.getUsers( params )
getusers method
{
headers = ...
options = ...
function callback ( error, response, body ) {
if ( all is correct ) {
// here I need to return a true
}
}
request( options, callback )
}
I need to get that "true" on the original call, but I only receive undefined. I also tried to make the return outside the callback but of course because it's async it doesnt return that true either.