GithubHelp home page GithubHelp logo

sudhir-pradhan / deep-email-validator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mfbx9da4/deep-email-validator

0.0 0.0 0.0 854 KB

Validates regex, typos, disposable, dns and smtp

License: MIT License

JavaScript 2.29% TypeScript 97.71%

deep-email-validator's Introduction

Email Validator

NPM

Validates email addresses based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.

  • Validates email looks like an email i.e. contains an "@" and a "." to the right of it.
  • Validates common typos e.g. [email protected] using mailcheck.
  • Validates email was not generated by disposable email service using disposable-email-domains.
  • Validates MX records are present on DNS.
  • Validates SMTP server is running.
  • Validates mailbox exists on SMTP server.
  • Native typescript support.

Getting Started

Comaptible with nodejs only. Not browser ready.

Install like so

npm i deep-email-validator --save

or with yarn

yarn add deep-email-validator

Use like so

import validate from 'deep-email-validator'
const main = async () => {
  let res = await validate('[email protected]')
  // {
  //   "valid": false,
  //   "reason": "smtp",
  //   "validators": {
  //       "regex": {
  //         "valid": true
  //       },
  //       "typo": {
  //         "valid": true
  //       },
  //       "disposable": {
  //         "valid": true
  //       },
  //       "mx": {
  //         "valid": true
  //       },
  //       "smtp": {
  //         "valid": false,
  //         "reason": "Mailbox not found.",
  //       }
  //   }
  // }

  // Can also be called with these default options
  await validate({
    email: '[email protected]',
    sender: '[email protected]',
    validateRegex: true,
    validateMx: true,
    validateTypo: true,
    validateDisposable: true,
    validateSMTP: true,
  })
}

Default options can be found here

deep-email-validator's People

Contributors

dependabot[bot] avatar ialex97 avatar mfbx9da4 avatar utob-ir avatar vlopp 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.