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
- To ensure the security and integrity of your projects, please note that official PearPass packages are distributed exclusively through our GitHub organization.
- Any packages with similar names found on the npm registry or other third-party package managers are not affiliated with PearPass and should be strictly avoided. We recommend installing directly from this repository to ensure you are using the verified, open-source version.
npm install git+https://github.com/tetherto/pearpass-utils-password-check.gitimport { checkPasswordStrength } from '@tetherto/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 '@tetherto/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.
- @tetherto/pearpass-app-mobile - A mobile app for PearPass, a password manager
- @tetherto/pearpass-app-desktop - A desktop app for PearPass, a password
- @tetherto/pearpass-lib-ui-react-native-components - A library of React Native UI components for PearPass
- @tetherto/pearpass-lib-ui-react-components - A library of React UI components for PearPass
- @tetherto/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.