{"_id":"mailcheck","_rev":"19-e3c9e42854419bcc05790b55b71c447c","name":"mailcheck","description":"A standalone module that suggests a right domain when your users misspell it in an email address.","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.3":{"name":"mailcheck","title":"mailcheck","description":"A standalone module that suggests a right domain when your users misspell it in an email address.","keywords":["form","email","spell check"],"version":"1.0.3","author":{"name":"Derrick Ko","email":"hello@derrickko.com","url":"http://derrickko.com"},"maintainers":[{"name":"aseemk","email":"aseem.kishore@gmail.com"}],"licenses":[{"type":"MIT","url":"https://github.com/Kicksend/mailcheck/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/Kicksend/mailcheck/issues"},"homepage":"https://github.com/Kicksend/mailcheck","docs":"https://github.com/Kicksend/mailcheck/blob/master/README.md","dependencies":{},"devDependencies":{"jasmine-node":"1.x"},"main":"src/mailcheck.js","repository":{"type":"git","url":"git://github.com/Kicksend/mailcheck.git"},"scripts":{"test":"jasmine-node spec/"},"_id":"mailcheck@1.0.3","dist":{"shasum":"af4f858547589a9939deeb04d22da62f52d32b15","tarball":"https://registry.npmjs.org/mailcheck/-/mailcheck-1.0.3.tgz","integrity":"sha512-FGt7dEomJhzykMbL13LdYG4IVTUVCY1VAwYlK9FbnuJ6nLjq1ngLufa/89IKnydYxpAbozOSHOxcTN5u0MO04g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+zK+OMUBMjPn5iBKT0ITt1JAIzFS950aYMoPTatJDUAiBbYfovUNoAXoGopR7in4af6kx23Kv0bL050WaoOggElQ=="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"aseemk","email":"aseem.kishore@gmail.com"}},"1.0.4":{"name":"mailcheck","title":"mailcheck","description":"A standalone module that suggests a right domain when your users misspell it in an email address.","keywords":["form","email","spell check"],"version":"1.0.4","author":{"name":"Derrick Ko","email":"hello@derrickko.com","url":"http://derrickko.com"},"maintainers":[{"name":"aseemk","email":"aseem.kishore@gmail.com"}],"licenses":[{"type":"MIT","url":"https://github.com/Kicksend/mailcheck/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/Kicksend/mailcheck/issues"},"homepage":"https://github.com/Kicksend/mailcheck","docs":"https://github.com/Kicksend/mailcheck/blob/master/README.md","dependencies":{},"devDependencies":{"jasmine-node":"1.x","grunt":"0.4.x","grunt-contrib-uglify":"~0.2.4","grunt-jasmine-node":"~0.1.0","grunt-cli":"~0.1.9"},"main":"src/mailcheck.js","repository":{"type":"git","url":"git://github.com/Kicksend/mailcheck.git"},"scripts":{"test":"grunt test","prepublish":"grunt test"},"_id":"mailcheck@1.0.4","dist":{"shasum":"a47d17a125e5b39157cfa5a5d7982e8bcd1d573e","tarball":"https://registry.npmjs.org/mailcheck/-/mailcheck-1.0.4.tgz","integrity":"sha512-vOzhpDjODGcUD1eX6WKCn7F5HT3RVlkQ69CcPdbeGZps94eiAJskunAaU4c+EFG9y7ZJjvvB6uPimWPJlq+R/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDA5VUesSTaRtWk5nGo/6WagKx2H9VG9xzjg4LXTYQdNAIgNJHOfHDL2NprveTG39JauMSRSH6h7XqLLasBfzLKfUU="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"aseemk","email":"aseem.kishore@gmail.com"}},"1.1.0":{"name":"mailcheck","title":"mailcheck","description":"A standalone module that suggests a right domain when your users misspell it in an email address.","keywords":["form","email","spell check"],"version":"1.1.0","author":{"name":"Derrick Ko","email":"hello@derrickko.com","url":"http://derrickko.com"},"maintainers":[{"name":"aseemk","email":"aseem.kishore@gmail.com"},{"name":"dko","email":"hello@derrickko.com"},{"name":"weilu","email":"luwei.here@gmail.com"}],"licenses":[{"type":"MIT","url":"https://github.com/mailcheck/mailcheck/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/mailcheck/mailcheck/issues"},"homepage":"https://github.com/mailcheck/mailcheck","docs":"https://github.com/mailcheck/mailcheck/blob/master/README.md","dependencies":{},"devDependencies":{"jasmine-node":"1.x","grunt":"0.4.x","grunt-contrib-uglify":"~0.2.4","grunt-jasmine-node":"~0.1.0","grunt-cli":"~0.1.9"},"main":"src/mailcheck.js","repository":{"type":"git","url":"git://github.com/mailcheck/mailcheck.git"},"scripts":{"test":"grunt test","prepublish":"grunt test"},"gitHead":"4d0a26d33e04f59e24ce2e858f731669b6ddc43a","_id":"mailcheck@1.1.0","_shasum":"849dfb42e170bcf34881ffc5bad4182ebec903a8","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.10.32","_npmUser":{"name":"weilu","email":"luwei.here@gmail.com"},"dist":{"shasum":"849dfb42e170bcf34881ffc5bad4182ebec903a8","tarball":"https://registry.npmjs.org/mailcheck/-/mailcheck-1.1.0.tgz","integrity":"sha512-co4YEPd2Z2kAa4n2X5pWMdtd33gG3Rxo28MselrUfjO46MAfeQi1JZTLs3eBMGE6LoY5CSA87iC9JZcQd04Jcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2CCPJa1yPX6q1GrvD8/xXeC2d8RX6TvlaV4HS9WNdHAiEA4gwSKA5lAzRVMUphXGeSiettN8K0ZJ/AnCV5/+XEEWY="}]}},"1.1.1":{"name":"mailcheck","title":"mailcheck","description":"A standalone module that suggests a right domain when your users misspell it in an email address.","keywords":["form","email","spell check"],"version":"1.1.1","author":{"name":"Derrick Ko","email":"hello@derrickko.com","url":"http://derrickko.com"},"maintainers":[{"name":"aseemk","email":"aseem.kishore@gmail.com"},{"name":"dko","email":"hello@derrickko.com"},{"name":"weilu","email":"luwei.here@gmail.com"}],"licenses":[{"type":"MIT","url":"https://github.com/mailcheck/mailcheck/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/mailcheck/mailcheck/issues"},"homepage":"https://github.com/mailcheck/mailcheck","docs":"https://github.com/mailcheck/mailcheck/blob/master/README.md","dependencies":{},"devDependencies":{"jasmine-node":"1.x","grunt":"0.4.x","grunt-contrib-uglify":"~0.2.4","grunt-jasmine-node":"~0.1.0","grunt-cli":"~0.1.9"},"main":"src/mailcheck.js","repository":{"type":"git","url":"git://github.com/mailcheck/mailcheck.git"},"scripts":{"test":"grunt test","prepublish":"grunt test","uglify":"grunt uglify"},"gitHead":"ee2eeea8935aee71e1c6a873dcfbe14384af2c21","_id":"mailcheck@1.1.1","_shasum":"d87cf6ba0b64ba512199dbf93f1489f479591e34","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.32","_npmUser":{"name":"weilu","email":"luwei.here@gmail.com"},"dist":{"shasum":"d87cf6ba0b64ba512199dbf93f1489f479591e34","tarball":"https://registry.npmjs.org/mailcheck/-/mailcheck-1.1.1.tgz","integrity":"sha512-3WjL8+ZDouZwKlyJBMp/4LeziLFXgleOdsYu87piGcMLqhBzCsy2QFdbtAwv757TFC/rtqd738fgJw1tFQCSgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3z4A+R3WmVgdRZKsz3IqB7nH8JuI4jaivTiy4CwCatAiBCt/UvzUTa4AxfmykSgSjktJCEtgrpUmU606x+wxlgHQ=="}]}}},"readme":"mailcheck.js\n=========\n\n[![TravisCI Build Status](https://secure.travis-ci.org/mailcheck/mailcheck.png?branch=master)](https://travis-ci.org/mailcheck/mailcheck)\n\nThe Javascript library and jQuery plugin that suggests a right domain when your users misspell it in an email address.\n\nWhat does it do?\n----------------\n\nWhen your user types in \"user@gmil.con\", Mailcheck will suggest \"user@gmail.com\".\n\nMailcheck will offer up suggestions for second and top level domains too. For example when a user types in \"user@hotmail.cmo\" then \"hotmail.com\" will be suggested. Similarly if only the second level domain is miss-spelled then it will be corrected independently of the top level domain allowing for fine resolution tweaking if desired.\n\nAt [Kicksend](http://kicksend.com), we use Mailcheck to help reduce typos in email addresses during sign ups. It has [reduced our sign up confirmation email bounces by 50%](http://blog.kicksend.com/how-we-decreased-sign-up-confirmation-email-b).\n\n![diagram](https://raw.githubusercontent.com/mailcheck/mailcheck/master/doc/example.png)\n\nSee it live in action [here](http://kicksend.com/join).\n\nInstallation\n------------\n\nFor instant use, download the minified library [mailcheck.min.js](https://raw.githubusercontent.com/mailcheck/mailcheck/d25dc9a119ca844bb35b1baf341cca0a634e4ac9/src/mailcheck.min.js) into your javascripts directory. [mailcheck.js](https://raw.githubusercontent.com/mailcheck/mailcheck/d25dc9a119ca844bb35b1baf341cca0a634e4ac9/src/mailcheck.js) is also available unminimised if you want to hack on it, or have your own minimizer.\n\n#### Bower ####\n\n```\n> bower install --save mailcheck\n```\n\n#### Node/Browserify ####\n\n```\n> npm install --save mailcheck\n```\n\nUsage with jQuery\n-----\n\nFirst, include jQuery and Mailcheck into the page.\n\n```html\n<script src=\"jquery.min.js\"></script>\n<script src=\"mailcheck.min.js\"></script>\n```\n\nHave a text field.\n\n```html\n<input id=\"email\" name=\"email\" type=\"email\" />\n```\n\nNow, attach Mailcheck to the text field. You can declare an array of domains, second level domains and top level domains you want to check against.\n\n```html\n<script>\nvar domains = ['gmail.com', 'aol.com'];\nvar secondLevelDomains = ['hotmail']\nvar topLevelDomains = [\"com\", \"net\", \"org\"];\n\nvar superStringDistance = function(string1, string2) {\n  // a string distance algorithm of your choosing\n}\n\n$('#email').on('blur', function() {\n  $(this).mailcheck({\n    domains: domains,                       // optional\n    secondLevelDomains: secondLevelDomains, // optional\n    topLevelDomains: topLevelDomains,       // optional\n    distanceFunction: superStringDistance,  // optional\n    suggested: function(element, suggestion) {\n      // callback code\n    },\n    empty: function(element) {\n      // callback code\n    }\n  });\n});\n</script>\n```\n\nMailcheck takes in two callbacks, `suggested` and `empty`. We recommend you supply both.\n\n`suggested` is called when there's a suggestion. Mailcheck passes in the target element and the suggestion. The suggestion is an object with the following members:\n\n```js\n{\n  address: 'test',          // the address; part before the @ sign\n  domain: 'gmail.com',    // the suggested domain\n  full: 'test@gmail.com'  // the full suggested email\n}\n```\nMailcheck does not want to get in the way of how you can show suggestions. Use the suggestion object to display suggestions in your preferred manner.\n\n`empty` is called when there's no suggestion. Mailcheck just passes in the target element. It is a good idea to use this callback to clear an existing suggestion.\n\nUsage without jQuery\n--------------------\n\nMailcheck is decoupled from jQuery, so its usage without jQuery is almost identical.\n\nUsing the example from above, you would call `Mailcheck.run` instead.\n\n```html\n<script>\nMailcheck.run({\n  email: yourTextInput.value,\n  domains: domains,                       // optional\n  topLevelDomains: topLevelDomains,       // optional\n  secondLevelDomains: secondLevelDomains, // optional\n  distanceFunction: superStringDistance,  // optional\n  suggested: function(suggestion) {\n    // callback code\n  },\n  empty: function() {\n    // callback code\n  }\n});\n</script>\n```\n\nThe rest works similarly. In fact, the Mailcheck jQuery plugin just wraps `Mailcheck.run`.\n\nUsage on Node.js\n----------------\n\nIf you're running this on Node.js, you can just `require('mailcheck')` to get the `mailcheck` object, and call `run` on that:\n\n```js\nvar mailcheck = require('mailcheck');\n\nmailcheck.run({\n  // see 'usage without jQuery' above.\n});\n```\n\nDomains\n-------\n\nMailcheck has inbuilt defaults if the `domains`, `secondLevelDomains` or `topLevelDomains` options aren't provided. We still recommend supplying your own domains based on the distribution of your users.\n\n#### Adding your own Domains ####\n\nYou can replace Mailcheck's default domain/TLD suggestions by supplying replacements to `mailcheck.run`:\n\n```js\nMailcheck.run({\n  domains: ['customdomain.com', 'anotherdomain.net'], // replaces existing domains\n  secondLevelDomains: ['domain', 'yetanotherdomain'], // replaces existing SLDs\n  topLevelDomains: ['com.au', 'ru'] // replaces existing TLDs\n});\n```\n\nAlternatively, you can *extend* Mailcheck's global set of default domains & TLDs by adding items to `Mailcheck.defaultDomains` and `Mailcheck.defaultTopLevelDomains`:\n\n```js\nMailcheck.defaultDomains.push('customdomain.com', 'anotherdomain.net') // extend existing domains\nMailcheck.defaultSecondLevelDomains.push('domain', 'yetanotherdomain') // extend existing SLDs\nMailcheck.defaultTopLevelDomains.push('com.au', 'ru') // extend existing TLDs\n```\n\nCustomization\n-------------\n\nThe Mailcheck jQuery plugin wraps Mailcheck. The prime candidates for customization are the methods\n`Mailcheck.findClosestDomain` and `Mailcheck.stringDistance`.\n\nMailcheck currently uses the [sift3](http://siderite.blogspot.com/2007/04/super-fast-and-accurate-string-distance.html) string similarity algorithm by [Siderite](http://siderite.blogspot.com/). You can modify the inbuilt string distance function, or pass in your own when calling Mailcheck.\n\nSince Mailcheck runs client side, keep in mind file size, memory usage and performance.\n\nTests\n-----\n\nMailcheck is tested with [Jasmine](https://jasmine.github.io/). Load `spec/spec_runner.html` in your browser to run the tests or run `npm test` from the command line to test in node.\n\nContributing\n------------\n\nLet's make Mailcheck awesome. We're on the lookout for maintainers and [contributors](https://github.com/mailcheck/mailcheck/contributors).\n\nAnd do send in those pull requests! To get them accepted, please:\n\n- Test your code. Add test cases to `spec/mailcheckSpec.js`, and run it across browsers (yes, including IE).\n- Minify the plugin by running `grunt` in the Mailcheck directory.\n\nUpcoming features, bugs and feature requests are managed in [Issues](https://github.com/mailcheck/mailcheck/issues).\n\nDeveloping on Nitrous.IO\n---------------------\n\nStart contributing to Mailcheck instantly on [Nitrous.IO](https://www.nitrous.io/?utm_source=github.com&utm_campaign=kicksend-mailcheck&utm_medium=hackonnitrous):\n\n[![Hack mailcheck/mailcheck on Nitrous.IO](https://d3o0mnbgv6k92a.cloudfront.net/assets/hack-l-v1-d464cf470a5da050619f6f247a1017ec.png)](https://www.nitrous.io/hack_button?source=embed&runtime=nodejs&repo=kicksend%2Fmailcheck&file_to_open=README.nitrous.md)\n\n\nWho have used Mailcheck?\n-----------------------\n\n- [Kicksend](http://kicksend.com/)\n- [Dropbox](http://dropbox.com/)\n- [Kickstarter](http://kickstarter.com/)\n- [Uber](http://uber.com/)\n- [Khan Academy](http://khanacademy.org/)\n- [Minecraft](http://minecraft.net/)\n- [Paperless Post](http://www.paperlesspost.com/)\n- [The Verge](http://theverge.com/)\n- [SB Nation](http://sbnation.com/)\n- [Kippt](http://kippt.com/)\n- [Shopify](http://shopify.com/)\n\nDo you use Mailcheck? [Tweet me](http://twitter.com/derrickko) your link.\n\nRelated Links\n-------------\n\n- [Official Mailcheck Ports](https://github.com/mailcheck/)\n- [Two ways to reduce bounced welcome emails](http://blog.postmarkapp.com/post/19685472721/two-ways-to-reduce-bounced-welcome-emails) by [Postmark](http://postmark.com)\n- [MooTools port](https://github.com/DimitarChristoff/mailcheck) by [Dimitar Christoff](https://github.com/DimitarChristoff)\n- [WordPress Plugin](https://github.com/bmoredrew/mailcheck-wordpress-plugin/) by [Drew Poland](https://github.com/bmoredrew)\n- [WordPress e-Commerce Plugin](http://wordpress.org/extend/plugins/e-commerce-mailcheck/)\n- [Mailcheck for Drupal](http://drupal.org/project/Mailcheck) by [Martin Elvar](https://twitter.com/MartinElvar)\n\nCore Team\n-------\n\n- Derrick Ko, [Kicksend](http://kicksend.com), [@derrickko](http://twitter.com/derrickko). Created Mailcheck.\n- Wei Lu, [Hive](https://www.hivewallet.com/), [@luweidewei](http://twitter.com/luweidewei).\n\nLicense\n-------\n\nReleased under the MIT License.\n","maintainers":[{"name":"aseemk","email":"aseem.kishore@gmail.com"},{"name":"dko","email":"hello@derrickko.com"},{"name":"weilu","email":"luwei.here@gmail.com"}],"time":{"modified":"2022-06-19T15:26:05.640Z","created":"2013-08-07T15:10:02.842Z","1.0.3":"2013-08-07T15:10:04.647Z","1.0.4":"2014-04-26T17:00:47.173Z","1.1.0":"2015-03-18T13:34:06.203Z","1.1.1":"2015-07-05T07:24:06.919Z"},"author":{"name":"Derrick Ko","email":"hello@derrickko.com","url":"http://derrickko.com"},"repository":{"type":"git","url":"git://github.com/mailcheck/mailcheck.git"},"homepage":"https://github.com/mailcheck/mailcheck","keywords":["form","email","spell check"],"bugs":{"url":"https://github.com/mailcheck/mailcheck/issues"},"readmeFilename":"README.md","users":{"arielfr":true,"soulevans07":true,"rocket0191":true,"omidfi":true,"agplan":true}}