Gathering detailed insights and metrics for yup-password
Gathering detailed insights and metrics for yup-password
Gathering detailed insights and metrics for yup-password
Gathering detailed insights and metrics for yup-password
check-password-complexity
A simple javascript utility to check password strength and complexity
yup-password-validator
A Yup extension that help to validate a complex password
persian-yup-ts
Persian rules in yup
@tiller-ds/formik-elements
Formik elements module of Tiller Design System
npm install yup-password
Typescript
Module System
Node Version
NPM Version
TypeScript (98.85%)
JavaScript (1.15%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
48 Stars
55 Commits
6 Forks
1 Watchers
2 Branches
1 Contributors
Updated on Sep 07, 2024
Latest Version
0.4.0
Package Id
yup-password@0.4.0
Unpacked Size
15.49 kB
Size
4.09 kB
File Count
6
NPM Version
9.5.1
Node Version
18.16.1
Published on
Mar 31, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
8
Yup, dead simple password validation.
Using npm:
1$ npm install yup-password
Using yarn:
1$ yarn add yup-password
Plug and play:
1// MJS / TS 2import * as yup from 'yup' 3import YupPassword from 'yup-password' 4YupPassword(yup) // extend yup
1// CJS 2const yup = require('yup') 3require('yup-password')(yup) // extend yup
1// Build schema 2const schema = yup.object().shape({ 3 username: yup.string().email().required(), 4 password: yup.string().password().required(), 5}) 6 7const input = { 8 username: 'user@example.com', 9 password: 'secret', 10} 11 12try { 13 // validate 14 const res = await schema.validate(input, { abortEarly: false }) 15 // ... 16} catch (e) { 17 console.log(e.errors) // => [ 18 // 'password must be at least 8 characters', 19 // 'password must contain at least 1 uppercase letter', 20 // 'password must contain at least 1 number', 21 // 'password must contain at least 1 symbol', 22 // ] 23}
Override, disable or add additional rules:
1const schema = yup.string().password() 2 .minLowercase(8) // raise the lowercase requirement to 8 3 .min(0) // disable minimum characters completely 4 .minWords(2) // add an additional rule 5 6try { 7 const res = await schema.validate('secret', { abortEarly: false }) 8 // ... 9} catch(e) { 10 console.log(e.errors) // => [ 11 // 'password must contain at least 2 words', <-- added 12 // 'password must contain at least 8 lowercase letters', <-- overridden 13 // 'password must contain at least 1 uppercase letter', 14 // 'password must contain at least 1 number', 15 // 'password must contain at least 1 symbol', 16 // ] 17}
Pick and choose your password rules:
1const schema = yup.string().min(6).minUppercase(3).maxRepeating(2).minWords(2)
2
3await schema.isValid('Now, THIS is some password.') // => true
4await schema.isValid('But thiiis is not.') // => false
Localize your error messages:
1yup.setLocale({ 2 string: { 3 minLowercase: 'Localized message (path=${path};length=${length})', 4 minUppercase: 'Localized message (path=${path};length=${length})', 5 minNumbers: 'Localized message (path=${path};length=${length})', 6 minSymbols: 'Localized message (path=${path};length=${length})', 7 maxRepeating: 'Localized message (path=${path};length=${length})', 8 minWords: 'Localized message (path=${path};length=${length})', 9 }, // when using typescript, you may want to append `as any` to the end 10 // of this object to avoid type errors. 11})
Password must meet the default requirements: at least 8 characters, at most 250 characters, at least 1 lowercase letter, at least 1 uppercase letter, at least 1 number and at least 1 symbol.
1const schema = yup.string().password()
Password must contain X amount of lowercase letters or more.
1const schema = yup.string().minLowercase(3, 'custom message')
Password must contain X amount of uppercase letters or more.
1const schema = yup.string().minUppercase(3, 'custom message')
Password must contain X amount of numbers or more.
1const schema = yup.string().minNumbers(3, 'custom message')
Password must contain X amount of symbols or more.
1const schema = yup.string().minSymbols(3, 'custom message')
Password must not contain a sequence of X amount of repeated characters. For example, if the limit is 2 thiis
will pass but thiiis
will not.
1const schema = yup.string().maxRepeating(3, 'custom message')
Password must contain X amount of words or more. So long as a sequence of characters contains letters or numbers,
it will be recognized as a word. For example secret
, 1st!
and 1337
count as words, but !@#$%
does not.
1const schema = yup.string().minWords(3, 'custom message')
This project is open-sourced software licensed under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More