6.13.23 • Published 11 months ago
email-address-checker v6.13.23
Email Validator
Simple email address syntax validator.
Features
- Check if domain is a common email domain. (gmail.com yahoo.com outlook.com)
- Check if domain extension is common. (.com .net .org)
- Check and make sure the @ symbol is present.
Returned Results
- GOOD: The email address is valid according to the criteria.
- NOSPECIAL: The @ symbol is missing.
- NOEXTENSION: There is no extension.
- NOPROVIDER: There is no provider.
Error Information
The errors are stackable. If the email does not have a extension or provider then it will return an array looking like this: 'NOPROVIDER', 'NOEXTENSION'
Customization
You can use the setParams function to set your own extension and providers.
Example Usage
Installation:
npm install email-address-checker
yarn add email-address-checker
Setup:
const { validateEmail, setParams } = require("email-address-checker");
validateEmail("user@gmail.com") // Returns GOOD -- Email is valid
validateEmail("usergmail.com") // Returns error -- No @ sign
Configuration:
const params = {
extensions: [".com"],
providers: ["gmal"]
};
setParams(params);
There will be no more updates to this module. Feel free to copy it and do whatever.