elboletaire/password-strength-meter
概要
:key: Accessible password strength meters for every framework.
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 履歴を収集中
- 15日間
- 履歴を収集中
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルAccessible password strength meters for every framework, built on one small core.
Live demo · Packages · Quick start · Core inspector · Brand
[!NOTE] About the name. Passcore is the name of the packages (
@passcore/*). It plays on pass score (the score of a password, written with onesbecause "passscore" repeated too many letters) and on core (the small core every package shares). This repository is still calledpassword-strength-meterbecause that is how it started: as a jQuery plugin with that name. The originalpassword-strength-meterpackage on npm is now a compatibility release; see Looking for the old plugin?.
Packages
| Package | Version | For |
|---|---|---|
@passcore/core |
Strength estimation and password rules. No dependencies, no DOM, no texts: use it to build your own UI or to validate on the server | |
@passcore/jquery |
$.fn.password: a jQuery plugin with an accessible meter |
|
@passcore/vanilla |
createPasswordMeter() for any page, and a <passcore-meter> custom element |
|
@passcore/react |
A hook and a component for React | |
@passcore/vue |
A composable and a component for Vue 3 | |
@passcore/svelte |
A component and a rune-based helper for Svelte 5 |
Pick the one for your stack: each binding depends on @passcore/core and renders the same markup, so they all behave and look alike.
Why Passcore
- Length first. The estimate counts how hard a password is to guess, and discounts repeats, sequences, keyboard runs, common passwords and personal details such as the username. Adding characters never makes a password look weaker, unless they complete a known weak word.
- Rules are separate from strength. Minimum length, required character types, "no personal details" and "not a common password" are configurable and reported on their own, so a long passphrase that misses one rule still shows its real strength.
- Accessible. A
role="meter"bar with ARIA values, and the message in a polite live region linked to the input. - Translated, your way. The core returns message keys, never texts. English, Spanish and Catalan are included in i18next's JSON format (see
locales/), and you can pass your owntranslatefunction, such as i18next'st. - Themeable. One stylesheet, colored with CSS custom properties, no images.
Quick start
pnpm add @passcore/react # or @passcore/vue, @passcore/svelte, @passcore/vanilla, @passcore/jquery
import { PasswordStrengthMeter } from '@passcore/react'
import '@passcore/react/styles.css'
function PasswordField({ password, onChange }: { password: string, onChange: (value: string) => void }) {
return (
<>
<input type="password" value={password} onChange={(e) => onChange(e.target.value)} aria-describedby="password-strength" />
<PasswordStrengthMeter password={password} id="password-strength" />
</>
)
}
Or skip the UI and use the core directly:
import { createMeter } from '@passcore/core'
const meter = createMeter({ rules: { minLength: 10 } })
const { percent, level, valid, message } = meter.evaluate('correct horse battery staple', ['johndoe'])
Each package's README has its options, events, translations and styling; the core's Stability section lists what changes only in a major release. The playground (pnpm dev) shows every package running, with the code for each case.
Looking for the old plugin?
password-strength-meter 2.x was a jQuery plugin. Its npm package now publishes version 3, a compatibility release that keeps the 2.x behavior and options, maintained on the v3 branch for fixes only, and it is deprecated in favor of @passcore/jquery. The new plugin has a different scoring system and different options: the @passcore/jquery README has a table that maps each old option to its replacement.
Development
pnpm install
pnpm dev # the playground, with the packages' sources (no build needed)
pnpm test # vitest, all packages (jQuery 3 and 4)
pnpm lint
pnpm typecheck
pnpm build # the packages (the playground has its own build)
Releases are managed with changesets.
Brand
The logo, colours, type and ready-to-use banners live in brand/, with a short guide on how to use them.
MIT · Made by Òscar Casajuana and contributors.
関連プロジェクトを探す
読み込み中…