1.0.1 • Published 2 years ago

email-validator-js v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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("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

License

MIT