Skip to content

0x010F/email-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

email-validator

Dead simple email validation library made for learning purpose

Motivation

  • Learn how to create a module in Node.js
  • Learn how to test your modules using Mocha & Chai
  • Learn how to publish a module on npm
  • Learn how to use regex

Installation

npm install @ppamkcl/email-validator

NPM link

https://www.npmjs.com/package/@ppamkcl/email-validator

How to use

// import the module
const validator = require("@ppamkcl/email-validator");

// Pass an email to validate function from validator
// returns an error if email is invalid
// returns null if email is valid
const error = validator.validate('[email protected]')
if (error) {
  console.log(error);
} else {
  console.log('Email is valid');
}

Author

Pranjal Alone [email protected]

About

Dead simple email validation library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published