correct-email
Correct common misspellings in an email address, based on Kicksend's Mailcheck library.
Installation
$ component install ianstormtaylor/correct-email
Example
var correct = require('correct-email');
var correction = correct('[email protected]');
{
local : 'test',
domain : 'gmail.com',
email : '[email protected]'
}
API
correct(string)
Returns a correction for the given email string
, or false
if nothing to correct.
correct.threshold(number)
Change the string distance threshold for matches.
correct.domains
The array of domain names to match against.
correct.tlds
The array of TLDs to match against.
License
MIT