strong-password-checker

The Password Checker returns a count of steps to pass the validation

Usage no npm install needed!

<script type="module">
  import strongPasswordChecker from 'https://cdn.skypack.dev/strong-password-checker';
</script>

README

strong-password-checker

NPM minzipped size downloads license
The Password Checker returns a count of steps to pass the validation.
This is a solution for the challenge.

Installation

npm

npm i strong-password-checker

yarn

yarn add strong-password-checker

Also, you can download a minified js file here.
It adds only strongPasswordChecker to global scope.

Using

This is a pure function, just provide a password and get the result.

import strongPasswordChecker from 'strong-password-checker'

strongPasswordChecker('a') // 5

You may use optional arguments, they have default values

function strongPasswordChecker (
  pass: string,
  minLength = 6,
  maxLength = 20,
  maxRepeat = 3,
  charConditions = [/[0-9]/, /[a-z]/, /[A-Z]/]
): number {}

Issues

If you find a bug or have a suggestion, please file an issue on GitHub.
issues


stars watchers