@cinnamon05370/password-utilities
v1.1.1
Published
Password utility helpers for generating and validating strong passwords.
Maintainers
Readme
password-utilities
Small JavaScript helpers for creating and validating strong passwords.
Installation
npm install @cinnamon05370/password-utilitiesyarn add @cinnamon05370/password-utilitiesUsage
const { generateStrongPassword, isStrongPassword } = require('@cinnamon05370/password-utilities');
const password = generateStrongPassword(12);
const strong = isStrongPassword(password);generateStrongPassword(length)
Generates a strong password using letters, numbers, and symbols. If the requested length is shorter than 8, the function uses 8 characters so the result can still be strong.
generateStrongPassword(1);
// a strong password with at least 8 charactersisStrongPassword(password)
Checks whether a password includes uppercase letters, lowercase letters, numbers, symbols, and at least 8 characters.
isStrongPassword('Hello World');
// false
isStrongPassword('pC%mD8TpCKn2');
// trueContributing
- Open an issue for bugs or feature ideas.
- Fork the repository and create a branch.
- Add tests for your change.
- Open a pull request with a clear description.
See the templates in this repository for guidance.
License
MIT. See LICENSE.md.
