There are lots of email address validation modules, but none of them seem to check for sane email addresses. This one does. If you don't agree, please file an issue and convince me why.
Support this project by donating on Gittip.
npm install sane-email-validation
var isEmail = require( "sane-email-validation" );
var email = "...";
if ( isEmail( email ) ) {
console.log( email + " is valid." );
} else {
console.log( email + " is not valid." );
}
An inverted check is also exposed.
var isNotEmail = require( "sane-email-validation" ).isNotEmail;
var email = "...";
if ( isNotEmail( email ) ) {
console.log( email + " is not valid." );
} else {
console.log( email + " is valid." );
}
Copyright Scott González. Released under the terms of the MIT license.
Support this project by donating on Gittip.