Disposable Email Validator: Block Disposable Emails and Plus Addressing

Disposable Email Validator: Block Disposable Emails and Plus Addressing

Summary

The `disposable-email-validator` library helps prevent fake signups by blocking disposable email addresses and optional plus addressing. It offers flexible, environment-specific rules, making it ideal for production applications while allowing development flexibility. This TypeScript-based tool provides a robust solution for email validation.

At a glance

Added to OSRepos
February 6, 2026
Last analyzed
February 6, 2026
View on GitHub

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

disposable-email-validator is a powerful TypeScript library designed to help applications block disposable email addresses and manage plus addressing with environment-specific rules. It's perfect for preventing fake signups in production environments while offering flexibility for development and testing. The library provides a robust, configurable solution to enhance the integrity of user registrations and communications.

Installation

Getting started with disposable-email-validator is straightforward. You can install it using npm:

npm install disposable-email-validator

Examples

Here's a quick example demonstrating how to configure and use the validator to block disposable emails in a production environment:

import { DisposableEmailValidator } from 'disposable-email-validator';

const config = {
  production: {
    rules: {
      allow_disposable_emails: false,
      allow_plus_addressing: false,
    }
  }
};

const validator = new DisposableEmailValidator('production', config);

const result = validator.validateEmail('user@10minutemail.com');
console.log(result);
// { success: false, error: 'Disposable email addresses are not allowed' }

The library supports highly flexible, environment-based configuration, allowing you to define different validation rules for development, staging, production, or any custom environment you create. You can also provide custom lists of disposable or trusted domains and control whether they merge with the built-in list.

Why Use This?

disposable-email-validator offers several compelling benefits for your applications:

  • Designed for production apps: Built with real-world scenarios in mind.
  • Prevent fake signups: Effectively blocks temporary emails that often lead to spam or fraudulent accounts.
  • Multiple environments supported: Easily adapt validation rules across different deployment stages.
  • Built-in domain blacklist: Comes with a comprehensive list of known throwaway providers out of the box.
  • Fast, typesafe, and extendable: Offers high performance, full TypeScript support, and easy customization.

Source repository

Open the original repository on GitHub.

17 counted GitHub visits

View on GitHub

Related repositories

Similar repositories that may be relevant next.

OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️