email-spam-checker

1.0.8 • Public • Published

Email Spam Checker

A wrapper of email validater. It's useful for backend to avoid spam emails.

  • This package uses email-addresses(https://www.npmjs.com/package/email-address) to validate email.
  • Using a list of domains for disposable and temporary email addresses (https://gist.github.com/adamloving/4401361) to avoid spam emails.

Install

$ npm install email-spam-checker

Usage

var emailChecker = require('email-spam-checker');
emailChecker('abc@xyz.com')
  .then(() => {
      // You give me a valid email ^^
  })
  .catch(err => {
      // Email is invalid
      const { type } = err;
      console.log(`Error type: ${type}`); 
  })

Error Types

  • 'EMAIL_INVALID': email is invalid
  • 'EMAIL_SPAM': domain's email is in blacklist

Package Sidebar

Install

npm i email-spam-checker

Weekly Downloads

5

Version

1.0.8

License

ISC

Unpacked Size

11.5 kB

Total Files

5

Last publish

Collaborators

  • thanhquangit92