email-misspelled
v4.4.0
Published
Check misspell email's domain and return a list of matching domain suggestions
Maintainers
Readme
Lightweight < 3ko lib
Check the misspelled email's domain and return a list of matching domain suggestions sorted by corrections needed
The string comparison is based on this algorithm
live codepen demo

Table of Contents
Install with npm:
npm i email-misspelledInstall with yarn:
yarn add email-misspelledimport emailMisspelled, { top100 } from "email-misspelled"
const emailChecker = emailMisspelled({ domains: top100 })
emailChecker("[email protected]")
/**
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/domains
| Type | Required | Description |
| :--- | :------- | :---------- |
| string[] DomainList | true | list of domains to compare |
import emailMisspelled from "email-misspelled"
const emailChecker = emailMisspelled({ domains: ["random.org"] })
emailChecker("[email protected]") // []
emailChecker("[email protected]")
/**
* return :
* [
* {
* suggest: "random.org",
* misspelledCount: 1,
* corrected:"[email protected]",
* original: "[email protected]"
* }
* ]
**/List of domains avaibles :
- Top 100 domains list
- Hotmail
- Live
- Outlook
- Microsoft (a combination of hotmail, live and outlook emails)
- Yahoo
- Aol
- Others domains
- All (all previous domains in one list)
examples
import { top100, hotmail, live } from "email-misspelled" Feel free to contribute
maxMisspelled
| Type | Required | Default | Description |
| :--- | :------- | :------ | :---------- |
| number | false | 2 | max possible misspelled |
import emailMisspelled, { top100 } from "email-misspelled"
const emailChecker1 = emailMisspelled({ maxMisspelled: 1, domains: top100 })
emailChecker1("[email protected]")
/**
* return :
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/
emailChecker1("[email protected]") // []
const emailChecker2 = emailMisspelled({ maxMisspelled: 3, domains: top100 })
emailChecker2("[email protected]")
/**
* return :
* [{
* suggest: "hotmail.com",
* misspelledCount: 2,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/
emailChecker2("[email protected]")
/**
* return :
* [{
* suggest: "hotmail.com",
* misspelledCount: 3,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/
emailChecker2("[email protected]") //4 misspelled, return []lengthDiffMax
| Type | Required | Default | Description |
| :--- | :------- | :------ | :---------- |
| number | false | 3 | max length difference between two string |
import emailMisspelled, { top100 } from "email-misspelled"
const emailChecker1 = emailMisspelled({ lengthDiffMax: 1, domains: top100 })
emailChecker1("[email protected]")
/**
* return :
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/
emailChecker1("[email protected]") // []
const emailChecker2 = emailMisspelled({ lengthDiffMax: 2, domains: top100 })
emailChecker2("[email protected]")
/**
* return :
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/
emailChecker2("[email protected]")
/**
* return :
* [{
* suggest: "gmail.com",
* misspelledCount: 1,
* corrected:"[email protected]",
* original: "[email protected]"
* },
* {
* suggest: "hotmail.com",
* misspelledCount: 2,
* corrected:"[email protected]",
* original: "[email protected]"
* }]
**/Top 100 domains list
ordered by number of existing email
gmail.comyahoo.comhotmail.comaol.comhotmail.co.ukhotmail.frmsn.comyahoo.frwanadoo.frorange.frcomcast.netyahoo.co.ukyahoo.com.bryahoo.co.inlive.comrediffmail.comfree.frgmx.deweb.deyandex.ruymail.comlibero.itoutlook.comuol.com.brbol.com.brmail.rucox.nethotmail.itsbcglobal.netsfr.frlive.frverizon.netlive.co.ukgooglemail.comyahoo.esig.com.brlive.nlbigpond.comterra.com.bryahoo.itneuf.fryahoo.dealice.itrocketmail.comatt.netlaposte.netfacebook.combellsouth.netyahoo.inhotmail.escharter.netyahoo.cayahoo.com.aurambler.ruhotmail.detiscali.itshaw.cayahoo.co.jpsky.comearthlink.netoptonline.netfreenet.det-online.dealiceadsl.frvirgilio.ithome.nlqq.comtelenet.beme.comyahoo.com.artiscali.co.ukyahoo.com.mxvoila.frgmx.netmail.complanet.nltin.itlive.itntlworld.comarcor.deyahoo.co.idfrontiernet.nethetnet.nllive.com.auyahoo.com.sgzonnet.nlclub-internet.frjuno.comoptusnet.com.aublueyonder.co.ukbluewin.chskynet.besympatico.cawindstream.netmac.comcenturytel.netchello.nllive.caaim.combigpond.net.au
