node.js - Process not waiting until get the data for api in nodejs -


i new nodejs. process not waiting until data mailgun api mail validation.

here code

var validator = require('mailgun-validate-email')('pubkey-xxxxxxxx')      validator(req.body.email, function (err, results)   {     console.log(results) // times getting response. of time getting undefind.     if(results.is_valid == true )     {        user.findone({ 'emails.email' : req.body.email}, function(err, doc){           console.log(doc)        })     }   }) 


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -