email-validator-js
v1.0.1
Published
This package enables you to validate and email and check whether it is a temorary email
Downloads
1
Maintainers
Readme
Email Validator js
This package enables you to validate and email and check whether 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("[email protected]")
.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("[email protected]")
.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("[email protected]")
.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