
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
email-password-validator
Advanced tools
A simple npm package for validating email, password, names, and custom fields.
README.md# email-password-validator
A lightweight TypeScript-based package for validating **emails, passwords, names, and custom fields** in real-time.
Designed for use in **Node.js** and **frontend frameworks** like React, Vue, or Angular.
---
## Installation
```bash
npm install email-password-validator
import { validateEmail } from "email-password-validator";
console.log(validateEmail("test@example.com"));
// { valid: true }
console.log(validateEmail("wrong-email"));
// { valid: false, error: "The provided email is an invalid email format" }
import { validatePassword } from "email-password-validator";
console.log(validatePassword("MyP@ssw0rd"));
// { valid: true, errors: [] }
console.log(validatePassword("weak"));
// { valid: false, errors: ["Password must be at least 8 characters", "At least one uppercase letter required", ...] }
Custom rules:
validatePassword("password123", { minLength: 6, requireSpecialChar: false });
// { valid: true, errors: [] }
import { validateName } from "email-password-validator";
console.log(validateName("John Doe"));
// { valid: true }
console.log(validateName("J1"));
// { valid: false, error: "Name can only contain letters and spaces" }
import { validateCustom } from "email-password-validator";
// Username validator: letters, numbers, underscores, 3–15 chars
const usernameCheck = validateCustom(
"user_123",
(val) => /^[a-zA-Z0-9_]{3,15}$/.test(val),
"Username must be 3-15 characters, letters/numbers/underscore only"
);
console.log(usernameCheck);
// { valid: true }
This package comes with Jest tests. Run:
npm test
import React, { useState } from "react";
import { validateEmail, validatePassword, validateName } from "email-password-validator";
export default function ExampleForm() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const emailResult = validateEmail(email);
const passwordResult = validatePassword(password);
return (
<div>
<input value={email} onChange={(e) => setEmail(e.target.value)} placeholder="Email" />
{!emailResult.valid && <p style={{ color: "red" }}>{emailResult.error}</p>}
<input type="password" value={password} onChange={(e) => setPassword(e.target.value)} placeholder="Password" />
{!passwordResult.valid && (
<ul style={{ color: "red" }}>
{passwordResult.errors.map((err, i) => <li key={i}>{err}</li>)}
</ul>
)}
</div>
);
}
MIT © 2025 [ENIGMA]
FAQs
A simple npm package for validating email, password, names, and custom fields.
The npm package email-password-validator receives a total of 3 weekly downloads. As such, email-password-validator popularity was classified as not popular.
We found that email-password-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.