A utility library to check the strength of passwords and passphrases based on configurable rules.
This utility provides functions to check the strength of passwords and passphrases based on configurable rules:
Password Validation:
- Minimum length requirements
- Uppercase and lowercase character inclusion
- Number inclusion
- Special character inclusion
Passphrase Validation:
- Minimum word count
- Unique words verification
- Capital letter inclusion
- Symbol inclusion
- Number inclusion
npm install pearpass-utils-password-checkimport { checkPasswordStrength } from 'pearpass-utils-password-check';
// With default rules
const result = checkPasswordStrength('Test123!');
console.log(result.strengthType); // safe
// With custom rules
const customResult = checkPasswordStrength('Test1234', {
length: 8,
includeSpecialChars: false,
lowerCase: true,
upperCase: true,
numbers: true
});
console.log(customResult.strengthType); // safe
console.log(customResult.rules); // Detailed rules assessmentimport { checkPassphraseStrength } from 'pearpass-utils-password-check';
// With default rules
const words = ['Test1!', 'Word2@', 'Example3#', 'Unique', 'Safe', 'Pass', 'Phrase', 'Another4$'];
const result = checkPassphraseStrength(words);
console.log(result.strength); // safe
// With custom rules
const customResult = checkPassphraseStrength(words, {
capitalLetters: true,
symbols: true,
numbers: true,
words: 6
});
console.log(customResult.strengthType); // safe
console.log(customResult.rules); // Detailed rules assessmentThis package has no runtime dependencies.
- pearpass-app-mobile - A mobile app for PearPass, a password manager
- pearpass-app-desktop - A desktop app for PearPass, a password
- pearpass-lib-ui-react-native-components - A library of React Native UI components for PearPass
- pearpass-lib-ui-react-components - A library of React UI components for PearPass
- tether-dev-docs - Documentations and guides for developers
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.