good-mail is a fast email validator with a domain exclusion option.
You can exclude domain that give temporary or throwalble email adresses. A list of such providers can be find in the project.
Get it running
npm install good-mail to install the package.
How to use
Require the package :
const gm = ;
If you just want to validate an email:
The method returns a boolean: true if the email is valid, false otherwise.
If you want to exclude certain domain names, pass them in an array of strings as second parameter.
const excludedDomains = ['trashmail.com', 'yopmail.com', 'spam.com'];gm.validate('email@example.com', excludedDomains);
Run the tests with
npm run test
Coverage & report
See the code coverage with
npm run coverage
Once you run the tests, you can check the coverage report with
npm run report