@vrun4750/emailvalidator
v1.0.1
Published
A simple package to validate emails
Downloads
16
Readme
Email Validator
A simple and lightweight Node.js package for validating email addresses with regex.
Features
- Regex-based email validation: Check if an email address is valid.
- Detailed error messages: Get insights on why validation failed.
- Customizable rules: Extend the default validation logic.
- CLI Support: Validate emails directly from the command line.
Installation
Install the package using npm or yarn:
npm install email-validator
Usage
- Import the validator
const { validateEmail } = require('email-validator');
- Validate an Email Address
const result = validateEmail('[email protected]');
console.log(result); // { valid: true, error: null }
CLI Usage
You can also use the package directly in your terminal:
npm install -g email-validator
npx email-validator [email protected]