email-regexp
v1.0.4
Published
a tiny email address regular expression validator
Downloads
4
Maintainers
Readme
email-regexp
A regular expression for validating regular email addresses.
Usage
Installation
With npm:
npm i email-regexp
Using yarn package manager:
yarn add email-regexp
Commonjs module
Using Commonjs module pattern:
const EmailRegex = require('email-regexp');
console.log(EmailRegex.isValid('[email protected]')) // => true
console.log(EmailRegex.isValid('[email protected]')) // => false
console.log(EmailRegex.isValid('[email protected]')) // => true
ES6 module
Using ES6 module pattern:
import EmailRegex from 'email-regexp'
console.log(EmailRegex.isValid('[email protected]')) // => true
console.log(EmailRegex.isValid('[email protected]')) // => false
console.log(EmailRegex.isValid('[email protected]')) // => true, //
api
EmailRegex.isValid(emailAddress: string) => boolean