email-validator-helper
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

E-mail Validator TS

NodeJS TypeScript NPM

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("test@email.com"); // true

TypeScript

import { Validator } from "email-validator-ts";

await Validator.emailVerify("test@email.com"); // true

For testing

// Input
console.log("🚀 Started Validator!")
console.log("1) Is the email 'test@mail.com' valid? ", await Validator.emailVerify("test@mail.com"))
console.log("2) Information about the email 'user@gmail.com': ", await Validator.emailAnalyze("user@gmail.com"))
console.log("3) Checks a list (array) of emails. Returns a list of valid and invalid emails: ", await Validator.emailList(["test@mail.com", "user@gmail.com", "mail@0000lol0000.com"]))

// Output
/*

🚀 Started Validator!

Verifying test@mail.com...

1) Is the email 'test@mail.com' valid?  true

Analyzing user@gmail.com...

2) Information about the email 'user@gmail.com':  
{"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: [ 'test@mail.com', 'user@gmail.com' ],
  invalid: [ 'mail@0000lol0000.com' ]
}

*/

🧑🏻‍💻 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.

Package Sidebar

Install

npm i email-validator-helper

Weekly Downloads

3

Version

0.0.10

License

MIT

Unpacked Size

14.5 kB

Total Files

8

Last publish

Collaborators

  • arturmedeiros