/sane-email-validation

Sanely validate email addresses, based on HTML5's definition of email addresses

Primary LanguageJavaScriptMIT LicenseMIT

Sane Email Validation

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.

Installation

npm install sane-email-validation

Usage

var isEmail = require( "sane-email-validation" );
var email = "...";

if ( isEmail( email ) ) {
	console.log( email + " is valid." );
} else {
	console.log( email + " is not valid." );
}

isNotEmail()

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." );
}

License

Copyright Scott González. Released under the terms of the MIT license.


Support this project by donating on Gittip.