email-normalize

Normalize email addresses to their canonical form

Usage no npm install needed!

<script type="module">
  import emailNormalize from 'https://cdn.skypack.dev/email-normalize';
</script>

README

email-normalize

This is a rewrite of email-normalize without Meteor stuff.

Installation

npm install --save email-normalize

Usage

const normalize = require('email-normalize');

// Sync version
const normalized = normalize('a.b.c@gmail.com'); // Output: 'abc@gmail.com'

// Async version (powered by Bluebird)
normalize('a.b.c@googlemail.com', { detectProvider: true }).then(normalized => {
  console.log(normalized); // Output 'abc@gmail.com'
});

License

MIT