Skip to content

Instantly share code, notes, and snippets.

@dineshsprabu
Created January 29, 2016 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dineshsprabu/f4bdfb0054abdc01211d to your computer and use it in GitHub Desktop.
Save dineshsprabu/f4bdfb0054abdc01211d to your computer and use it in GitHub Desktop.
Validate email id on nodejs
/* 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