2.0.3 • Published 25 days ago

email-js v2.0.3

Weekly downloads
17
License
MIT
Repository
github
Last release
25 days ago

email-js

npm version Coverage Status Inline docs

Installation

npm install --save email-js

Usage

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

API

isValidEmail(email: string) => boolean

Returns true if the email is valid. The address is validated on by the same regex used by Webkit.

isValidEmail('root@localhost') // => true

getDomainPart(email: string) => string

Returns the domain part of the email.

getDomainPart('root@localhost') // => 'localhost'

getLocalPart(email: string) => string

Returns the local part of the email.

getLocalPart('root@localhost') // => 'root'
2.0.3

25 days ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

7 years ago

1.4.0

9 years ago

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago