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 - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

8

example/check_email.js

@@ -1,5 +0,5 @@

var legit = require('../index.js');
const legit = require('../index.js');
legit('martyn@sendgrid.com', function(validation, addresses) {
if (validation === true) {
legit('martyn@martyndavies.me', function(err, validation, addresses) {
if (validation == true) {
console.log('This is a real email that can accept emails!');

@@ -10,2 +10,2 @@ console.log(JSON.stringify(addresses));

}
});
});

@@ -1,13 +0,13 @@

var dns = require('dns');
const dns = require('dns');
module.exports = function(emailAddress, cb) {
'use strict';
var splitEmail = emailAddress.split('@');
let splitEmail = emailAddress.split('@');
dns.resolveMx(splitEmail[1], function(err, addresses){
if (addresses) {
cb(true, addresses, null);
cb(null, true, addresses);
} else {
cb(false, null, err);
cb(err, false, null);
}
});
};
{
"name": "legit",
"version": "0.0.5",
"description": "Check that email addresses are really able to accept emails",
"version": "0.0.6",
"description": "Check that email addresses are really able to accept emails by pinging the DNS and checking for active MX records.",
"main": "index.js",
"respository": "https://github.com/martyndavies/legit",
"devDependencies":{

@@ -7,0 +8,0 @@ "should": "*",

@@ -5,4 +5,2 @@ # Legit

[![Build Status](https://travis-ci.org/martyndavies/legit.png?branch=master)](https://travis-ci.org/martyndavies/legit)
## Installation

@@ -16,10 +14,10 @@

```javascript
var checkEmail = require('legit');
const legit = require('legit');
checkEmail('martyn@sendgrid.com', function(validation, addresses, err) {
if (validation) {
legit('martyn@martyndavies.me', function(err, 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.');
console.log('Error: '+ err);
}

@@ -42,2 +40,2 @@ });

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@@ -1,4 +0,4 @@

var assert = require('assert');
var should = require('should');
var legit = require('../');
const assert = require('assert');
const should = require('should');
const legit = require('../');

@@ -8,3 +8,3 @@ describe('Testing Emails', function(){

it('should return true when email is legit', function(){
legit('martyn@sendgrid.com', function(validation, addresses){
legit('martyn@martyndavies.me', function(err, validation, addresses){
validation.should.be.true;

@@ -18,8 +18,9 @@ should.exist(addresses);

it('should return false when email is not legit', function(){
legit('nosir@neverwouldibuythisdomainladdyohno.com', function(validation, addresses){
legit('nosir@neverwouldibuythisdomainladdyohno.com', function(err, validation, addresses){
validation.should.be.false;
should.not.exist(addresses);
should.exist(err);
});
});
});
});
});

Sorry, the diff of this file is not supported yet

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