Skip to content

TypeScript rewrite of zxcvbn with strict types and bug fixes #369

@KunalTanwar

Description

@KunalTanwar

Hi! I've written a full TypeScript rewrite of zxcvbn called zxcvbn-ts in case anyone is looking for a type-safe alternative.

It includes:

  • Strict TypeScript with a discriminated-union Match type for exhaustive pattern narrowing
  • Dual CJS/ESM output
  • All 93,855 dictionary words bundled
  • Optional AI-powered feedback via zxcvbnAI() — returns a plain-English explanation of exactly why a password is weak, powered by Claude (bring your own API key)
  • A few bug fixes over the original (notably a lazy-init bug that silently disabled all dictionary matching when setUserInputDictionary was called first)

Available on npm: bun add zxcvbn-ts / npm install zxcvbn-ts

Happy to take feedback or PRs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions