https://github.com/anibalalpizar/secure-password-checker
🔒 Secure Password Checker A robust library for customizable password validation, designed to enhance security and prevent weak or compromised credentials.
https://github.com/anibalalpizar/secure-password-checker
npm-package password security typescript
Last synced: 5 months ago
JSON representation
🔒 Secure Password Checker A robust library for customizable password validation, designed to enhance security and prevent weak or compromised credentials.
- Host: GitHub
- URL: https://github.com/anibalalpizar/secure-password-checker
- Owner: anibalalpizar
- License: mit
- Created: 2024-12-04T07:44:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-05T02:05:07.000Z (over 1 year ago)
- Last Synced: 2025-04-12T04:35:22.911Z (over 1 year ago)
- Topics: npm-package, password, security, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/secure-password-checker
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔒 Secure Password Checker
A robust, configurable password validation library to ensure user credential security.
## 📦 Installation
```bash
npm install secure-password-checker
```
## 🚀 Quick Start
```typescript
import {
validatePassword,
CommonPasswordsValidator,
} from "secure-password-checker";
const password = "MyStrongPassword123!";
const validationResult = validatePassword(password);
if (validationResult.isValid) {
console.log("Password is secure.");
} else {
console.log("Password is not secure:", validationResult.errors);
}
```
## 🛡️ Features
- Configurable password validation
- Length checks
- Complexity requirements
- Common password rejection
- Extensible blocked password list
## 🔧 Customization
### Validation Options
```typescript
const options = {
minLength: 10,
maxLength: 20,
requireUpperCase: true,
requireLowerCase: true,
requireNumbers: true,
requireSpecialChars: true,
rejectCommonPasswords: true,
};
const result = validatePassword(password, options);
```
### Custom Common Passwords
```typescript
// Add specific passwords to blocked list
CommonPasswordsValidator.addCommonPasswords("company2024", "admin123");
// Add multiple passwords from an array
const blockedPasswords = ["company2024", "test1234"];
CommonPasswordsValidator.addCommonPasswordsFromArray(blockedPasswords);
// Get current blocked passwords
console.log(CommonPasswordsValidator.getCommonPasswords());
// Remove passwords from blocked list
CommonPasswordsValidator.removeCommonPasswords("admin123");
```
## 📋 Validation Criteria
- Minimum/maximum length
- Uppercase letter requirement
- Lowercase letter requirement
- Number requirement
- Special character requirement
- Common password detection
## 📄 License
MIT License