Created
January 29, 2016 07:49
-
-
Save dineshsprabu/f4bdfb0054abdc01211d to your computer and use it in GitHub Desktop.
Validate email id on nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* npm install validator */ | |
var validator = require('validator'); | |
/* email id to check */ | |
var email_id = 'email@domain.com' | |
/* validator.isEmail can do the job for us */ | |
if (validator.isEmail(email_id)){ | |
console.log(' valid email '); | |
} | |
else{ | |
console.log(' not valid! '); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment