Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 1.07 KB

File metadata and controls

66 lines (40 loc) · 1.07 KB

validate-email

Simple email validator

Below are the sample supported formats.

Valid: [email protected] [email protected] [email protected]

Invalid: [email protected] basha:[email protected] basha+gmail.com [email protected]

Install

$ npm install --save validateemail

Usage

const validator= require('validateemail');
validator.validate("addressToValidate");

validator.validate("[email protected]"); // true
validator.validate("[email protected]"); // false


validator.validateAsync("[email protected]", function(isValid) {
    Logic based on isValid
});

API

validate(addressToValidate)

Returns a boolean.

addressToValidate

Type: string

Email address to validate.

validate(addressToValidate, callback)

Calls the callback method, with the boolean result.

Contribute

Contributions to validateemail are most welcome, check the LICENSE file for more info.

License

Distributed under the MIT license. See LICENSE for more information. bashasm whyjsnow.com