1.0.4 • Published 6 years ago
good-mail v1.0.4
Good mail
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
Run npm install good-mail
to install the package.
How to use
Require
Require the package :
Javascript
const gm = require('good-mail');
Typescript
import * as gm from 'good-mail';
Usage
If you just want to validate an email:
gm.validate('test@email.com');
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('test@email.com', excludedDomains);
You can find a list of disposable email providers in the project, or check the list online.
Unit tests
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