strong-strong-password-by-yuvaldromi
v1.0.0
Published
Generate strong passwords
Maintainers
Readme
Strong Password Generator
A TypeScript library for generating strong, secure passwords.
Features
- Generates strong passwords with configurable length (minimum 8 characters)
- Ensures at least one character from each category:
- Capital letters (A-Z)
- Small letters (a-z)
- Digits (0-9)
- Special symbols (!@#$%^&*()_+~`|}{[]:;?><,./-=)
- Random distribution of characters throughout the password
Installation
npm install strongest password for useBuild
npm run buildUsage
In TypeScript
import { generator } from 'strong-strong-password-by-yuvaldromi';
// Generate a password with default length (10 characters)
const password1: string = generator.strongPassword();
console.log(password1); // e.g., "A$3bX9@mK2"
// Generate a password with custom length
const password2: string = generator.strongPassword(16);
console.log(password2); // e.g., "T7!hG2@sL5#pQ9&x"
// Generate multiple passwords
const passwords: string[] = Array.from({ length: 5 }, () =>
generator.strongPassword(12)
);
console.log(passwords);
// Use in a function
function createUserPassword(minLength: number = 12): string {
return generator.strongPassword(minLength);
}
const userPassword = createUserPassword();
console.log(`Your new password: ${userPassword}`);In JavaScript
const { generator } = require('strong-strong-password-by-yuvaldromi');
// Generate a password with default length (10 characters)
const password1 = generator.strongPassword();
// Generate a password with custom length
const password2 = generator.strongPassword(16);
console.log(password1); // e.g., "A$3bX9@mK2"
console.log(password2); // e.g., "T7!hG2@sL5#pQ9&x"API
strongPassword(length?: number): string
Generates a strong password.
Parameters:
length(optional): The length of the password. Default is 10. Minimum is 8.
Returns:
- A string containing the generated password.
Author
Yuval
License
ISC
