Email Inspector
Email Inspector is a Node.js package for validating and inspecting email addresses.
Installation
You can install this package using npm:
npm install email-inspector
Usage
Here's how you can use Email Inspector in your Node.js application:
const emailInspector = require('email-inspector');
const email = 'user@example.com';
if (emailInspector.validate(email)) {
console.log('Email is valid');
} else {
console.log('Email is invalid');
}
Validation Against Free Email Providers
Email Inspector is designed to verify email addresses against a curated list of free email providers. This validation ensures that your business communication remains uninterrupted and can operate smoothly.
Using IANA List of Registered TLDs
Email Inspector relies on the IANA (Internet Assigned Numbers Authority) list of registered Top-Level Domains (TLDs) to validate email addresses. This list is regularly updated and maintained to include all officially recognized TLDs on the internet.
By leveraging the IANA list, Email Inspector ensures that email addresses are validated against the most up-to-date and comprehensive collection of TLDs. This helps you maintain accurate email validation and ensures that your application remains in compliance with internet standards.
To learn more about the IANA list of registered TLDs, visit IANA's official website.
Options
You can customize the behavior of Email Inspector using the following options:
-
customFreeProviders (Array): An array of custom free email providers to consider during validation.
-
providersToRemove (Array): An array of email providers to exclude from the list of free providers during validation.
Examples
const emailInspector = require('email-inspector');
const isValid = emailInspector.validate('user@example.com');
console.log(isValid);
const customProviders = ['customprovider.net'];
const isValidCustom = emailInspector.validate('user@customprovider.net', { customFreeProviders: customProviders });
console.log(isValidCustom);
Contributing
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your fork.
- Submit a pull request to the main repository.
License
MIT
Author
Weasely