Password strength analysis
Score passwords from weak to strong with labels and policy-aware validation feedback.

Lightweight password strength and policy analysis for modern JavaScript apps.
Features
PassGuardJS goes beyond checking whether a password matches a regex. It helps developers explain what is weak, what passed, and what the user can improve.
Score passwords from weak to strong with labels and policy-aware validation feedback.
Configure length, character requirements, score thresholds, banned terms, and custom rules.
Flag predictable passwords and extend the built-in list with your own blocked values.
Detect keyboard walks such as qwerty, asdf, and similar predictable patterns.
Catch repeated runs such as aaaaaa or 111111 before they pass a format-only check.
Compare passwords against names, emails, usernames, phone numbers, years, and locations.
Written in TypeScript with published type definitions for editor-friendly integration.
Designed as a lightweight runtime dependency-free package for JavaScript projects.
Installation
Install the package, import the analyzer, and wire the returned result into your form UI or validation flow.
npm install passguardjsimport { analyzePassword } from "passguardjs";
const result = analyzePassword("MyStrongPass123!", {
minLength: 12,
requireUppercase: true,
requireLowercase: true,
requireNumber: true,
requireSpecialChar: true,
});
console.log(result);Live Demo
Strength score
0/100
Result
Very Weak
Status: Needs attention
All checks run locally in your browser.
Documentation Preview
Start with the core API, configure a policy, read the result object, and adapt the examples to your stack.
Core API
Use analyzePassword(password, policy?) to return a score, strength label, validity flag, issues, suggestions, and detailed rule checks.
Configuration
Set minLength, minScore, required character classes, common password blocking, keyboard checks, repeated character limits, and custom rules.
Typed output
Read score, strength, isValid, issues, suggestions, and checks to power UI feedback or form validation.
Frameworks
Integrate with React, Vanilla JS, Node.js, Vue, Angular, and CommonJS environments using the same analysis API.
Why PassGuardJS?
A regex can confirm that a password contains a number, symbol, or uppercase character. It cannot explain whether that password is common, repetitive, keyboard-like, personal, or simply too predictable for the policy you are trying to enforce.
PassGuardJS is built for meaningful analysis and developer-friendly feedback: return a score, list the issues, suggest safer choices, and keep the checks close to the product experience where users can act on them.