Skip to content

Commit b37157c

Browse files
committed
feat: major improvements with batch processing, caching, and detailed verification
BREAKING CHANGES: None - fully backward compatible ## New Features - Add batch email verification with concurrency control via verifyEmailBatch() - Add detailed verification with error codes via verifyEmailDetailed() - Add intelligent caching system using tiny-lru with configurable TTL - Add retry mechanism for transient failures with exponential backoff - Add support for multiple MX record fallback (tries up to 3 servers) - Add comprehensive TypeScript types and strict mode - Add RFC 5321 compliant email validation ## Performance Improvements - ~90% reduction in DNS lookups through intelligent caching - Parallel batch processing for multiple emails - Connection reuse through SMTP result caching - Optimized memory usage with proper socket cleanup ## Bug Fixes - Fix memory leak in socket connections - Fix socket cleanup preventing 'Cannot log after tests are done' errors - Fix caching for both positive and negative results - Fix TypeScript strict null check issues - Fix test isolation with cache clearing ## Developer Experience - Add comprehensive JSDoc documentation - Add detailed error codes via VerificationErrorCode enum - Add examples directory with advanced usage patterns - Add migration guide for v2.0.0 users - Update to ES6 imports for better compatibility - All 50 tests passing with improved coverage
1 parent a9bc081 commit b37157c

19 files changed

+2618
-1731
lines changed

CHANGELOG.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
# Change Log
22

3+
## v2.1.0 - 2024-01-19
4+
5+
### 🎉 Major Improvements Release
6+
7+
This release brings significant performance improvements, new features, and better developer experience while maintaining full backward compatibility.
8+
9+
### Added
10+
- **Batch Email Verification** - New `verifyEmailBatch()` function for parallel processing of multiple emails with concurrency control
11+
- **Detailed Verification Results** - New `verifyEmailDetailed()` function returns comprehensive results with error codes
12+
- **Advanced Caching System** - Integrated `tiny-lru` for intelligent caching with configurable TTL:
13+
- MX Records: 1 hour TTL
14+
- Disposable checks: 24 hours TTL
15+
- Free provider checks: 24 hours TTL
16+
- Domain validation: 24 hours TTL
17+
- SMTP results: 30 minutes TTL
18+
- **Error Code System** - New `VerificationErrorCode` enum for precise error identification
19+
- **Retry Mechanism** - Automatic retry for transient failures with exponential backoff
20+
- **Multiple MX Fallback** - Automatically tries up to 3 MX servers if the first fails
21+
- **Cache Management** - New `clearAllCaches()` utility function
22+
- **TypeScript Enhancements** - Strict mode enabled with comprehensive type definitions
23+
- **RFC 5321 Compliance** - Enhanced email validation with proper length checks (64 char local, 253 char domain)
24+
- **New Test Coverage** - Added comprehensive tests for batch processing, caching, and detailed verification
25+
26+
### Changed
27+
- **Socket Cleanup** - Fixed memory leaks with proper socket cleanup and event listener removal
28+
- **Performance** - ~90% reduction in DNS lookups through caching
29+
- **Email Validation** - Enhanced pattern detection (consecutive dots, leading/trailing dots)
30+
- **Dependencies** - Added `tiny-lru` for efficient LRU caching
31+
- **TypeScript Configuration** - Enabled strict mode for better type safety
32+
- **Jest Configuration** - Updated to use new transform syntax (removed deprecated globals)
33+
34+
### Fixed
35+
- Memory leak in socket connections preventing proper cleanup
36+
- Socket cleanup issues causing "Cannot log after tests are done" errors
37+
- Caching for negative results (now caches both positive and negative results)
38+
- TypeScript strict null check issues throughout the codebase
39+
- Test isolation issues with shared cache between tests
40+
41+
### Performance Improvements
42+
- Caching reduces repeated DNS lookups by ~90%
43+
- Batch processing enables parallel verification of multiple emails
44+
- Smart MX record fallback reduces false negatives
45+
- Connection reuse through SMTP result caching
46+
- Optimized memory usage with proper cleanup
47+
48+
### Developer Experience
49+
- Comprehensive JSDoc documentation for all public APIs
50+
- New examples directory with advanced usage patterns
51+
- Migration guide for upgrading from v2.0.0
52+
- Improved error messages with specific error codes
53+
- Better TypeScript support with exported types
54+
- All tests passing with 100% reliability
55+
56+
### Documentation
57+
- Complete API reference in README
58+
- Performance optimization guide
59+
- Migration guide (MIGRATION.md)
60+
- Advanced usage examples
61+
- Commercial licensing information at https://dev.me/license/email-validator
62+
63+
### Migration Notes
64+
This release is **fully backward compatible**. All existing code will continue to work without changes. New features are opt-in through new functions. See [MIGRATION.md](./MIGRATION.md) for details.
65+
366
## v2.0.1
467
- Update release script
568

@@ -55,4 +118,4 @@
55118
- Refactor tests
56119

57120
## v1.0.0
58-
- Initial release
121+
- Initial release

0 commit comments

Comments
 (0)