password-policy

0.0.3 • Public • Published

password-policy

Helps to check a string for different types of password-policies.

Install

npm install password-policy

Example

const passwordPolicy = require('password-policy');
 
passwordPolicy.hasLowerCase('Test'); // => true

Functions:

  • hasUpperCase
  • hasLowerCase
  • hasNumber
  • hasSpecialCharacter
hasUpperCase(password, (times = 1))

Returns true if the number of uppercase-characters in the password is more than times.

hasLowerCase(password, (times = 1))

Returns true if the number of lowercase-characters in the password is more than times.

hasNumber(password, (times = 1))

Returns true if the number of numeric-characters in the password is more than times.

hasSpecialCharacter(password, (times = 1))

Returns true if the number of special-characters in the password is more than times.

Package Sidebar

Install

npm i password-policy

Weekly Downloads

639

Version

0.0.3

License

MIT

Last publish

Collaborators

  • j00nz