@anclp/node_email_verifier
v1.1.3
Published
a node module to verify email addresses by checking their MX records, uses go for the heavy lifting
Downloads
1,874
Maintainers
Readme
@anclp/node_email_verifier
Ultra-fast email verification for Node.js, powered by a Go-compiled native engine. (source: https://github.com/jay6909/go_email_verifier)
Installation
npm install @anclp/node_email_verifier
Why this package?
Most Node.js email validators only check syntax with RegEx. This package uses a native Go binary to perform actual DNS lookups, making it significantly more reliable and faster for bulk verification.
Usage
javascript
const { verifyEmail } = require('@anclp/node_email_verifier');
// Perform a full check (Syntax + MX Records)
const isValid = verifyEmail("[email protected]");
if (isValid) {
console.log("Email is valid and has active mail servers!");
} else {
console.log("Invalid email or non-existent domain.");
}
## Batch Verification ⚡
For high-volume processing, use the `verifyEmailsBatch` method. This uses Go's native goroutines to verify thousands of emails in parallel, bypassing the overhead of the Node.js event loop.
### Usage
```javascript
const { verifyEmailsBatch } = require('@anclp/emailverifier');
const emails = [
"[email protected]",
"[email protected]",
"[email protected]"
];
const results = verifyEmailsBatch(emails);
// results is an array of booleans: [true, false, false]
results.forEach((isValid, index) => {
console.log(`${emails[index]}: ${isValid ? '✅ Valid' : '❌ Invalid'}`);
});
Performance Metrics
On a standard consumer laptop (e.g., Asus TUF), this engine achieves:
Single Check: ~4.6ms
Batch Throughput: 2,800+ emails/second (verified via network MX lookups).
[!TIP]
Use Batch Verification when processing lists larger than 50 emails to maximize throughput.
