common-password-rules

Validation methods for some common password policies.
Install
npm install common-password-rules
Usage
const cPR = require('common-password-rules');
cPR.containsLowerCase('Foo');
API
containsLowerCase(password, [times]) ⇒ Boolean
Checks whether the given password contains a lowercase letter.
password | String | | Password string |
[times] | Integer | 1 | Minimum number of required lowercase letters |
containsUpperCase(password, [times]) ⇒ Boolean
Checks whether the given password contains an uppercase letter.
password | String | | Password string |
[times] | Integer | 1 | Minimum number of required uppercase letters |
containsDigit(password, [times]) ⇒ Boolean
Checks whether the given password contains a digit.
password | String | | Password string |
[times] | Integer | 1 | Minimum number of required digits |
containsSpecialChar(password, [times]) ⇒ Boolean
Checks whether the given password contains a special (non-word) character.
password | String | | Password string |
[times] | Integer | 1 | Minimum number of required special characters |
contains(password, charSet, [times]) ⇒ Boolean
Checks whether the given password contains a character from the given set.
password | String | | Password string |
charSet | String | | A regex character set |
[times] | Integer | 1 | Minimum number of required characters |
excludesRecurringChars(password, [times]) ⇒ Boolean
Checks that the given password does not contain recurring alphanumeric
characters.
password | String | | Password string |
[times] | Integer | 3 | Minimum recursion number |
excludesSequentialLetters(password, [times]) ⇒ Boolean
Checks that the given password does not contain sequential
case-insensitive letters.
password | String | | Password string |
[times] | Integer | 3 | Minimum sequence |
excludesSequentialDigits(password, [times]) ⇒ Boolean
Checks that the given password does not contain sequential digits.
password | String | | Password string |
[times] | Integer | 3 | Minimum sequence |
excludesBirthDate(password) ⇒ Boolean
Checks that the given password does not a possible birth-date.
password | String | Password string |
License
MIT http://tameraydin.mit-license.org/