daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest May 17th, 2018 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.registerUser = async function registerUser(req, res) {
  2.     let emailStatus = await checkUserEmail(req.body.email);
  3.  
  4.  
  5.  
  6.  if (emailStatus) {
  7.     console.log('This is a valid email!');
  8.  } else {
  9.     console.log('This is not a valid email!');
  10.  }
  11. }
  12.  
  13.  
  14.  
  15. function checkUserEmail(email) {
  16.     return new Promise(resolve => {
  17.         resolve(validator.validate(email));
  18.     })
  19. }
RAW Paste Data
Top