Email Validator js
This package enables you to validate an email and check if it is a temorary email
Installation
yarn add email-validator-js
Or
npm install email-validator-js
Installation
import EmailValidator from "email-validator-js";
Available functions
Check syntax
new EmailValidator("example@gmail.com")
.syntax()
.then(data =>{
// do something with the data
/**
* DATA FORMAT
* error:boolean
* email:string
* message:string
*/
})
.catch(error =>{
// handle error
})
Check if email has a valid domain
new EmailValidator("example@gmail.com")
.domain()
.then(data =>{
// do something with the data
/**
* DATA FORMAT
* error:boolean
* email:string
* message:string
* address: string[]
*/
})
.catch(error =>{
// handle error
})
Check if email is a temp mail
new EmailValidator("example@gmail.com")
.temp()
.then(data =>{
// do something with the data
/**
* DATA FORMAT
* error:boolean
* email:sting
* message:string
* temp:boolean
*/
})
.catch(error =>{
// handle error
})
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. This is package is still work in progress