A fast and efficient email validation toolkit built with Bun. This package provides utilities for:
- Email format validation using regex
- Disposable email detection with auto-updating domain list
- Domain extraction and validation
- Email existence checking via MX records and SMTP verification
bun add email-toolkit
import { EmailToolkit } from "email-toolkit";
const toolkit = new EmailToolkit();
// Comprehensive validation
const result = await toolkit.validateEmail("test@example.com");
console.log(result);
// {
// isValid: true,
// domain: "example.com",
// isDisposable: false,
// exists: true,
// hasValidMX: true
// }
// Individual utilities
toolkit.isValidEmail("test@example.com"); // true
toolkit.isDisposableDomain("temp-mail.org"); // true
toolkit.getDomain("test@example.com"); // "example.com"
- Format validation using robust regex patterns
- MX record verification
- SMTP connection testing (with fallback)
- Disposable email domain detection
- Built with Bun for optimal speed
- MX record caching
- Efficient domain lookup using Set
- Minimal dependencies
Creates a new toolkit instance.
Performs comprehensive email validation including format, MX records, SMTP verification, and disposable domain detection.
Checks if email format is valid and has valid MX records.
Checks if domain is known to be disposable.
Extracts and returns the domain from an email address.