npm install --save email-js
const { isValidEmail, getDomainPart, getLocalPart } = require('email-js');
console.log(isValidEmail('robot@example.com')); // => true
console.log(getDomainPart('robot@example.com')); // => example.com
console.log(getLocalPart('robot@example.com')); // => robot
Returns true if the email is valid. The address is validated on by the same regex used by Webkit.
isValidEmail('root@localhost') // => true
Returns the domain part of the email.
getDomainPart('root@localhost') // => 'localhost'
Returns the local part of the email.
getLocalPart('root@localhost') // => 'root'