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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@valentech/validate-email

v1.0.4

Published

Import the module and call `validateEmail` with an email string. The function returns a promise that resolves to a `ValidateEmailResult` object, providing both overall validity and detailed diagnostic information.

Downloads

1

Readme

Usage

Import the module and call validateEmail with an email string. The function returns a promise that resolves to a ValidateEmailResult object, providing both overall validity and detailed diagnostic information.

import validateEmail from "@valentech/validate-email";

async function runValidation() {
  const email = "[email protected]";
  const result = await validateEmail(email);

  if (result.valid) {
    console.log("Email is valid!", result.details);
  } else {
    console.error("Invalid email:", result.reason);
    if (result.suggestion) {
      console.info("Did you mean:", result.suggestion);
    }
  }
}

runValidation();

API

validateEmail(email: string): Promise

Returns: A promise that resolves to an object with the following structure:

| Property | Type | Description | | ---------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | valid | boolean | Indicates if the email passed all checks. | | reason | string | null | Error identifier when validation fails. Possible values include:invalid_syntaxdisposable_domaindns_timeoutinvalid_domaindns_errorunknown_error | | suggestion | string | null | Provides a suggested correction if the domain appears mistyped. | | details | object | Detailed result of various validation checks: |

details structure

| Property | Type | Description | | ------------- | --------------- | --------------------------------------------------------------- | | syntax | boolean | Result of the basic email syntax check. | | disposable | boolean | Whether the email belongs to a disposable domain. | | mxRecords | boolean | Whether MX DNS records were found. | | aRecords | boolean | Whether A/AAAA DNS records were found. | | smtpHandshake | boolean | null | Outcome of the SMTP handshake test (if performed). | | smtpPort | number | null | The port on which the SMTP handshake succeeded (if applicable). |

Features

Syntax Verification

Uses a regular expression along with the validator package to ensure the email is correctly formatted.

Disposable Domain Filtering

Compares the email's domain against a list of known disposable domains.

DNS Verification

Uses Node's DNS promises to check for MX and A/AAAA records. If no MX records are found but A/AAAA records are available, an SMTP handshake is attempted.

SMTP Handshake

Performs multi-port SMTP handshakes (plaintext on ports 25, 587, 2525 and TLS on port 465) to check if the domain can accept emails.

Typo Correction

Leverages a SymSpell-based lookup to suggest corrections for common email provider typos.

Caching

Utilizes LRU caches for email validations and DNS lookups to optimize performance.