email-validation-util
v1.0.2
Published
An npm package to validate email address.
Downloads
7
Readme
email-validator
A simple JavaScript package to validate email addresses.
Installation
You can install the package via npm:
npm install email-validation-util
Usage
javascript
const isValidEmail = require("email-validation-util");
console.log(isValidEmail("[email protected]")); // Output: true
console.log(isValidEmail("notanemail")); // Output: false
Function Documentation
isValidEmail(email: string): boolean
Checks if the provided email address is valid.
email
: The email address to validate.- Returns
true
if the email address is valid,false
otherwise.
Example
javascript
const isValidEmail = require("email-validation-util");
if (isValidEmail(userInput)) {
console.log("Email address is valid");
} else {
console.log("Invalid email address");
}