custommailvalidator
v1.0.4
Published
email validator
Readme
custommailvalidator
A custom email validation library for Node.js and the browser. It provides a simple way to validate email addresses in your application.
Installation
Install the package via npm:
npm i custommailvalidatorUsage
Basic Usage:
To use custommailvalidator, import it into your project and use the provided validation function.
const { validateEmail } = require('custommailvalidator');
// Example email
const email = '[email protected]';
if (validateEmail(email)) {
console.log('Valid email address.');
} else {
console.log('Invalid email address.');
}ES6 Import:
If you're using ES6 modules:
import { validateEmail } from 'custommailvalidator';
const email = '[email protected]';
if (validateEmail(email)) {
console.log('Valid email address.');
} else {
console.log('Invalid email address.');
}API
validateEmail(email: string)
- Parameters: A string representing the email address to validate.
- Returns:
trueif the email address is valid,falseotherwise.
Examples
// Valid email
validateEmail('[email protected]'); // true
// Invalid email
validateEmail('invalid-email'); // falseLicense
This project is licensed under the MIT License.
For any inquiries, please contact Sumit kumar.
