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

legit

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

legit

Check that email addresses are really able to accept emails

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
688
increased by8.35%
Maintainers
1
Weekly downloads
 
Created
Source

Legit

A wrapper for the NodeJS Dns.resolveMx method that checks the domain of an email address for valid/existence of MX records.

Installation

$ npm install legit

Usage

var checkEmail = require('legit');

checkEmail('martyn@sendgrid.com', function(validation, addresses) {
	if (validation === true) {
		console.log('This is a real email that can accept emails!');
		console.log(JSON.stringify(addresses));
	} else {
		console.log('This domain cannot accept emails, you might want to remove it.');
	}
});

If an email addresses domain is legit then the validation will be true and an array of MX records will be returned as well. If the domain has no MX or cannot resolve any MX then it will return false and the addresses will be null.

Keywords

FAQs

Package last updated on 23 Aug 2013

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