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

is-this-mail-fake

v1.0.0

Published

Detect fake, disposable, and temporary email addresses. Zero dependencies. 500+ domains built-in.

Downloads

39

Readme

is-this-mail-fake 🚫

Detect fake, disposable, and temporary email addresses instantly. 670+ domains built-in. Zero dependencies. Works in Node + Browser.

npm version Zero deps License: MIT


Install

npm install is-this-mail-fake

Quick Start

import { isFake, isReal } from 'is-this-mail-fake';

isFake('[email protected]')    // true
isFake('[email protected]')       // true
isFake('[email protected]')     // true
isFake('[email protected]')        // false
isFake('[email protected]')       // false

API

isFake(email)boolean

Returns true if the email uses a disposable/fake provider.

import { isFake } from 'is-this-mail-fake';

isFake('[email protected]')   // true
isFake('[email protected]')// true
isFake('[email protected]')       // false
isFake('invalid-email')         // false  (invalid = not fake)
isFake(null)                    // false  (safe — no crash)

isReal(email)boolean

Opposite of isFake. Returns true if email looks legitimate.

import { isReal } from 'is-this-mail-fake';

isReal('[email protected]')         // true
isReal('[email protected]')    // false

check(email)object

Full result with domain and reason.

import { check } from 'is-this-mail-fake';

check('[email protected]')
// {
//   email:  '[email protected]',
//   domain: 'mailinator.com',
//   fake:   true,
//   reason: 'disposable'
// }

check('[email protected]')
// { email: '[email protected]', domain: 'gmail.com', fake: false, reason: 'clean' }

check('not-an-email')
// { email: 'not-an-email', domain: null, fake: false, reason: 'invalid_email' }

Reasons:

| Reason | Meaning | |---|---| | disposable | Domain is in the built-in blocklist | | disposable_subdomain | Subdomain of a known disposable provider | | blacklisted | In your custom blacklist | | whitelisted | In your custom whitelist — trusted | | clean | Not found in any list | | invalid_email | Not a valid email format |


checkMany(emails[])object[]

Check multiple emails at once.

import { checkMany } from 'is-this-mail-fake';

checkMany(['[email protected]', '[email protected]', '[email protected]'])
// [
//   { email: '[email protected]',       fake: false, reason: 'clean' },
//   { email: '[email protected]',  fake: true,  reason: 'disposable' },
//   { email: '[email protected]',     fake: true,  reason: 'disposable' },
// ]

filterReal(emails[])string[]

Keep only real emails from a list.

import { filterReal } from 'is-this-mail-fake';

filterReal(['[email protected]', '[email protected]', '[email protected]'])
// ['[email protected]', '[email protected]']

filterFake(emails[])string[]

Keep only fake emails from a list.

import { filterFake } from 'is-this-mail-fake';

filterFake(['[email protected]', '[email protected]', '[email protected]'])
// ['[email protected]', '[email protected]']

isFakeDomain(domain)boolean

Check a domain directly without a full email.

import { isFakeDomain } from 'is-this-mail-fake';

isFakeDomain('mailinator.com')   // true
isFakeDomain('gmail.com')        // false

blacklist(domain | domain[]) — Custom blocklist

Add your own domains to always treat as fake.

import { blacklist, isFake } from 'is-this-mail-fake';

blacklist('internal-test.xyz');
blacklist(['disposable.io', 'temp-users.co']);

isFake('[email protected]')   // true

whitelist(domain | domain[]) — Custom allowlist

Trust specific domains — always bypass all checks.

import { whitelist, isReal } from 'is-this-mail-fake';

// Your own org domains
whitelist('enrole.ai');
whitelist(['growbharatbiz.com', 'logixbuilt.com']);

isReal('[email protected]')   // true  (even if it ever appeared in a list)

Unknown domains are always treated as real. Only domains explicitly in the built-in blocklist are flagged. Use whitelist() to guarantee your org domains are never blocked.


getLists() — See custom lists

import { getLists } from 'is-this-mail-fake';

getLists()
// { blacklist: ['internal-test.xyz'], whitelist: ['enrole.ai'] }

domainCount()number

Total domains in built-in blocklist.

import { domainCount } from 'is-this-mail-fake';

domainCount()   // 670

CLI

# Single email
npx is-this-mail-fake [email protected]

# Multiple emails at once
npx is-this-mail-fake [email protected] [email protected] [email protected]

# JSON output
npx is-this-mail-fake [email protected] --json

Output:

  ✗  FAKE   [email protected]          (disposable)
  ✓  REAL   [email protected]
  ✗  FAKE   [email protected]             (disposable)

Exit code 1 if any email is fake — useful for CI/scripts.


Common Use Cases

Signup form validation (Node.js)

import { isFake } from 'is-this-mail-fake';

app.post('/register', (req, res) => {
  const { email } = req.body;

  if (isFake(email)) {
    return res.status(400).json({
      error: 'Disposable email addresses are not allowed. Please use a real email.'
    });
  }

  // proceed with registration...
});

NestJS / class-validator pipe

import { isFake } from 'is-this-mail-fake';
import { registerDecorator } from 'class-validator';

export function IsNotFakeEmail() {
  return registerDecorator({
    name: 'isNotFakeEmail',
    validator: {
      validate: (email: string) => !isFake(email),
      defaultMessage: () => 'Disposable email addresses are not allowed',
    },
  });
}

// Usage in DTO:
class RegisterDto {
  @IsEmail()
  @IsNotFakeEmail()
  email: string;
}

React form validation

import { isFake } from 'is-this-mail-fake';

function EmailInput({ value, onChange }) {
  const fake = value && isFake(value);

  return (
    <div>
      <input value={value} onChange={e => onChange(e.target.value)} />
      {fake && <p style={{ color: 'red' }}>Disposable emails are not allowed</p>}
    </div>
  );
}

Clean a mailing list

import { filterReal, checkMany } from 'is-this-mail-fake';

const emailList = ['[email protected]', '[email protected]', '[email protected]', '[email protected]'];

// Keep only real
const clean = filterReal(emailList);
// ['[email protected]', '[email protected]']

// Get details on all
const report = checkMany(emailList);
const fakeCount = report.filter(r => r.fake).length;
console.log(`Removed ${fakeCount} disposable emails`);

CI — block fake emails in tests

# In your CI pipeline
npx is-this-mail-fake $TEST_EMAIL
# exits 1 if fake — fails the pipeline

How It Works

  1. Extracts the domain from the email ([email protected]mailinator.com)
  2. Custom whitelist check — whitelisted domains always pass (your org domains)
  3. Custom blacklist check — your own blocked domains
  4. Built-in list lookup — O(1) Set lookup against 670+ known disposable domains
  5. Wildcard match — catches subdomains like bob.mailinator.com

All lookups are in-memory and synchronous — no network calls, no async, no latency.


License

MIT © Adarsh


Contributing

PRs welcome! To add more domains, edit src/domains.js.