npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

email-assassin

v0.0.3

Published

Lightweight email validation package with advanced features including MX record validation and blacklisting, dependency free.

Downloads

15

Readme

email-assassin

Build Status dependencies Status devDependencies Status Vulns License: MIT

Lightweight email validation package for Node.js

Features

  • Syntax Validation - Validates email address format / syntax based on RFC standards.
  • Email Blacklisting - Optionally validate against a list of over 550 disposable / problem email services.
  • MX Record Validation - Validate whether the email address has valid MX DNS records attached at the domain level.
  • Gmail Alias Detection - Optional detection of Gmail addresses using an alias address. More Information

Install

$ npm install email-assassin

To install devDependices for testing run from the project folder:

npm install
npm test

To run included examples:

node ./example/checkEmail.js
node ./example/mxRecords.js

Usage

emailTools.syntax({email: [address], options: {}})

  • Method to validate email addresses directly.
  • Valid response object: { validation: true }
  • Invalid response object: { validation: false, reason: [ressonString] }

Optional Options Object

  • blacklist - <boolean> - Enable to validate against the blacklist, returns invalid if matched. Defaults to false.
  • gmailAlias - <boolean> - If enabled GMail alias addresses will return invalid. Defaults to false.
  • rfcLength - <boolean> - Validates the length of various address parts based on RFC standards. Defaults to true.
// include email-assassin
var validate = require('email-assassin');

// test an email
var test = validate.syntax({
  email: '[email protected]',
  options:{
    blacklist: true,
    gmailAlias: true
  }
});

// output to console
console.log(test);

emailTools.mxrecrods(<email>)

  • Used to validate MX records of a given email's domain / service.
  • Valid response object: { validation: true }
  • Invalid response object: { validation:false, reason:'No MX Records Found' }
// include email-assassin
var validate = require('email-assassin');

// make async request
(async () => {
  try {
    const response = await validate.mxrecords('[email protected]');
    console.log(response);
  } catch (e) {
    console.log(e);
  }
})();

Gmail Alias Addresses

What Are They Gmail allows users to utilize the '+' symbol in the username position to add aliases to an account name. For instance if your email address was [email protected] you could use [email protected] and any email sent to the address would go to [email protected]

Why Should I Check For Them In most cases denying usage for an alias address is not required. They are RFC valid syntax and allow Gmail users to tightly monitor where email is coming from and who might be spamming them. There are some use cases where you may want to disallow usage:

  • Users creating multiple accounts for a website using the same address. By quickly adding an alias they can make another account as the email is different.
  • Signing up for things like free trials and discounts, users can keep signing up for them easily by using alias addresses.

License

MIT © Tyler Colwell