Coder Social home page Coder Social logo

sayak119 / node-email-validator Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 17 KB

This is a npm package that checks if email is valid or not and also raises a flag if an email ID is temporary, belongs to a private org or that mail server is not used much.

License: ISC License

JavaScript 100.00%
npm-package npm nodejs dns mx-record

node-email-validator's Introduction

node-email-validator

This npm package checks that whether an email address is a valid email address or not by checking the MX records. It also has a statistics based check that whether an email address has a possibility of being a temporary email, email belonging to a private organization or that mail server is not used much in that region. It also checks if the email address structure follows RFC 5322 Official Standard or not.

How to install?

  • Just run the following statement.
npm install node-email-validator

or

npm i node-email-validator

How to use it?

  • Given below is an example on how to use this package.
var nev = require('node-email-validator');
nev('[email protected]').then(validation => {console.log(validation);}).catch(error => console.log(error));
  • The output for this is as follows.
{
  user: 'xukrlrll',
  domain: 'sharklasers.com',
  isEmailValid: true,
  mxRecords: [ { exchange: 'mail.guerrillamail.com', priority: 0 } ],
  possibility: true,
  timeout: false
}

What is present in the response?

  • user - This contains the username part of the email address.
  • domain - This contains the domain part of the email address.
  • isEmailValid - This returns true or false depending on the validity of the email address.
  • mxRecords - It contains the MX records which are dictionaries of exchange and priority or [] if nothing is present.
  • probability - This returns true or false depending on the possibility of an email address being a temporary email, email belonging to a private organization or that mail server is not used much in that region.
  • timeout - This returns true or false depending on the fact that the query caused timeout or not.

How to run tests?

  • For running the tests, run the following command.
npm test

License

ISC

node-email-validator's People

Contributors

sayak119 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.