Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

block-temp-mail

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

block-temp-mail

A lightweight package to detect and block disposable or temporary email addresses, helping prevent spam and fake account registrations.

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

block-temp-mail

A lightweight Node.js package to detect disposable/temporary email addresses. Protect your app from fake signups by verifying whether an email belongs to a temporary mail service.

Installation

npm install block-temp-mail

Usage

ESM

import { verifyEmail } from "block-temp-mail";

const result = await verifyEmail("user@tempmail.com");
console.log(result);

CommonJS

const { verifyEmail } = require("block-temp-mail");

async function check() {
  const result = await verifyEmail("user@tempmail.com");
  console.log(result);
}

check();

API

verifyEmail(email: string): Promise<VerifyEmail>

Checks whether the given email is a disposable/temporary email address.

Parameters:

ParameterTypeDescription
emailstringThe email address to verify

Returns: Promise<VerifyEmail>

type VerifyEmail = {
  success: boolean;
  message: string;
  data: {
    isTemporary: boolean;
    isValid: boolean;
    message: string;
  };
};

Response Examples

Temporary email detected:

{
  "success": true,
  "message": "Email verified successfully.",
  "data": {
    "isTemporary": true,
    "isValid": true,
    "message": "Temporary email."
  }
}

Valid, non-temporary email:

{
  "success": true,
  "message": "Email verified successfully.",
  "data": {
    "isTemporary": false,
    "isValid": true,
    "message": "Valid email."
  }
}

Invalid email format:

{
  "success": false,
  "message": "Invalid email format.",
  "data": {
    "isTemporary": false,
    "isValid": false,
    "message": "Invalid email."
  }
}

Use Cases

  • Block disposable emails during user registration
  • Validate email quality in lead generation forms
  • Prevent abuse in free-tier signups

License

MIT - Tara Chand Kumawat

Keywords

disposable-email

FAQs

Package last updated on 09 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts