Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

email-check

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-check

Utility to check if an email address exists

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82
decreased by-77.29%
Maintainers
1
Weekly downloads
 
Created
Source

Email check

David npm

Introduction

Email check is a npm async module for NodeJS, that checks if an email address exists.

It first validates the email through regex, and then pings the relative MX server.

It works with native JS promises (and needs a JS engine that supports them).

Install

npm install email-check

(add "--save" if you want the module to be automatically added to your project's "package.json" dependencies)

Usage

emailCheck(email, [opts])

The function signature accepts two arguments and returns a promise, eventually fulfilled with true if the email address exists, or false if it doesn't.

  • email (string) the email address to check.
  • opts (object) the options object.

The options object can have three properties:

  • from (string) email address originating the request (defaults to the same value as "email").
  • host (string) fqdn of SMTP server originating the request (defaults to an empty string).
  • timeout (number) max allowed idle time in milliseconds (defaults to 5000).

Example

var emailCheck = require('email-check');

// Quick version
emailCheck('mail@example.com')
  .then(function (res) {
    console.log(res);
  })
  .catch(function (err) {
    console.error(err);
  });

// With custom options
emailCheck('mail@example.com', {
  from: 'address@domain.com',
  host: 'mail.domain.com',
  timeout: 3000
})
  .then(function (res) {
    console.log(res);
  })
  .catch(function (err) {
    console.error(err);
  });


MIT License

FAQs

Package last updated on 21 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc