email-address-checker

6.13.23 • Public • Published

Email Validator

Simple email address syntax validator.

Features

  • Check if domain is a common email domain. (gmail.com yahoo.com outlook.com)
  • Check if domain extension is common. (.com .net .org)
  • Check and make sure the @ symbol is present.

Returned Results

  • GOOD: The email address is valid according to the criteria.
  • NOSPECIAL: The @ symbol is missing.
  • NOEXTENSION: There is no extension.
  • NOPROVIDER: There is no provider.

Error Information

The errors are stackable. If the email does not have a extension or provider then it will return an array looking like this: [ 'NOPROVIDER', 'NOEXTENSION' ]

Customization

You can use the setParams function to set your own extension and providers.

Example Usage

Installation:

npm install email-address-checker
yarn add email-address-checker

Setup:

const { validateEmail, setParams } = require("email-address-checker");
validateEmail("user@gmail.com") // Returns GOOD -- Email is valid
validateEmail("usergmail.com") // Returns error -- No @ sign

Configuration:

const params = {
  extensions: [".com"],
  providers: ["gmal"]
};
setParams(params);

There will be no more updates to this module. Feel free to copy it and do whatever.

Readme

Keywords

Package Sidebar

Install

npm i email-address-checker

Weekly Downloads

2

Version

6.13.23

License

ISC

Unpacked Size

3.27 kB

Total Files

3

Last publish

Collaborators

  • nobleraptor229