email-validator-helper
v0.0.10
Published
This package provides your application with several types of email validation: syntax, domain, MX server, and much more.
Downloads
14
Maintainers
Readme
E-mail Validator TS
About
This package provides your application with several types of email validation: syntax, domain, MX server, and much more.
✅ Requirements
To use the project, you need to have some packages and starter packages on your computer. See the standard requirements by Node.JS.
- GIT
- Node.JS
- NPM / YARN
⬇️ Installation
Install via NPM:
npm install email-validator-ts
Install via YARN:
yarn add email-validator-ts
🚀 Usage
JavaScript
const { Validator } = require("email-validator-ts");
await Validator.emailVerify("[email protected]"); // true
TypeScript
import { Validator } from "email-validator-ts";
await Validator.emailVerify("[email protected]"); // true
For testing
// Input
console.log("🚀 Started Validator!")
console.log("1) Is the email '[email protected]' valid? ", await Validator.emailVerify("[email protected]"))
console.log("2) Information about the email '[email protected]': ", await Validator.emailAnalyze("[email protected]"))
console.log("3) Checks a list (array) of emails. Returns a list of valid and invalid emails: ", await Validator.emailList(["[email protected]", "[email protected]", "[email protected]"]))
// Output
/*
🚀 Started Validator!
Verifying [email protected]...
1) Is the email '[email protected]' valid? true
Analyzing [email protected]...
2) Information about the email '[email protected]':
{"valid":true,"message":"The email seems valid.","data":{"server":"alt4.gmail-smtp-in.l.google.com","priority":40,"domain":"gmail.com","valid_domain":true,"ipv4":"142.251.9.26","addresses":[{"ip":"142.251.9.27","type":"IPv4"},{"ip":"2a00:1450:4025:c03::1a","type":"IPv6"}],"asn_data":{"142.251.9.26":{"range":"142.251.9.0/24","countryCode":"US","ASN":"15169","registrar":"arin","dateString":"2012-05-24","description":"GOOGLE, US"}}}}
Verifying list to 3 emails ...
3) Checks a list (array) of emails. Returns a list of valid and invalid emails:
{
valid: [ '[email protected]', '[email protected]' ],
invalid: [ '[email protected]' ]
}
*/
🧑🏻💻 Author
⚖️ License
MIT License
Copyright (c) 2022 @ARTURMEDEIROS - ARJOS.COM.BR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.