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

tempsanitizer

v1.0.0

Published

Check email domain validity, risk score, and MX records

Readme

Tempsanitizer

Verify email domains — validate deliverability, assess risk, detect disposable and temporary email addresses, and inspect MX records.

Features

  • Domain validity check (accept/reject for sign-ups)
  • Risk scoring (0–100)
  • Disposable & temporary email detection
  • MX host & IP resolution
  • Email provider identification
  • Domain age lookup
  • Possible typo suggestions

Install

npm install tempsanitizer

Usage

const checkDomain = require("tempsanitizer");

// Valid domain
const result = await checkDomain("gmail.com");
console.log(result.valid);    // true
console.log(result.risk);     // 8
console.log(result.mx_host);  // gmail-smtp-in.l.google.com

// Disposable domain
const disposable = await checkDomain("mailinator.com");
console.log(disposable.is_disposable); // true

// Invalid domain
const invalid = await checkDomain("nonexistentxyz123.com");
console.log(invalid.valid);   // false

API

checkDomain(domain)

| Parameter | Type | Description | |-----------|------|-------------| | domain | string | The domain name to check (e.g. "gmail.com") |

Returns a Promise that resolves to a result object.

Response Fields

| Field | Type | Description | |-------|------|-------------| | valid | boolean | Whether the domain is safe to accept for sign-ups | | block | boolean | Whether the domain is explicitly blocked | | domain | string | The queried domain | | base_domain | string | Root domain extracted | | text | string | Human-readable verdict | | reason | string | Reason for the verdict | | risk | number | Risk score from 0 (safe) to 100 (high risk) | | is_disposable | boolean | True if domain offers temporary/disposable emails | | is_email_forwarder | boolean | True if domain is an email forwarding service | | is_public_free | boolean | True if domain is a public free email provider | | is_public_premium | boolean | True if domain is a premium email provider | | is_business_provider | boolean | True if domain is a business email provider | | is_isp_email | boolean | True if domain is an ISP-provided email | | is_email_api | boolean | True if domain is an email API service | | is_web_hosting_email | boolean | True if domain is a web hosting email | | is_self_hosted | boolean | True if domain is self-hosted email | | is_parked | boolean | True if domain appears parked | | is_role_based_email | boolean | True if domain suggests role-based addressing | | mx_host | string | Primary MX hostname | | mx_ip | string | Primary MX IP address | | mx_info | string | MX resolution details | | mx_fallback | boolean | Whether fallback MX was used | | mx_hosts | string[] | All MX hostnames | | mx_ips | string[] | All MX IP addresses | | mx_priorities | object | MX priority mapping | | email_provider | string | Identified email provider name | | disposable_provider | string | Identified disposable provider name | | possible_typo | string[] | Suggested typo corrections | | domain_age_days | number | Age of the domain in days | | domain_created_at | string | Domain creation date (ISO 8601) | | block_status_changed_at | string | Last block status change date |

Error Handling

On failure, the function returns an object with an error field instead of throwing:

const result = await checkDomain("");
console.log(result.error); // "Request failed with status code 400"

Examples

Check before sign-up

async function allowSignup(email) {
  const domain = email.split("@")[1];
  const { valid, is_disposable, risk } = await checkDomain(domain);
  return valid && !is_disposable && risk < 30;
}

Get full domain intelligence

const info = await checkDomain("outlook.com");
console.log(`Provider: ${info.email_provider}`);
console.log(`Age: ${info.domain_age_days} days`);
console.log(`MX: ${info.mx_host} (${info.mx_ip})`);

License

ISC