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

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -