Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

strongpassword

1.1.4 • Public • Published

StrongPassword

NPM version Downloads Build Status Coveralls Status Codecov Status

Check if the password is strong.

Here an example of a strong password check:

var strongPasswordValidation = new StrongPassword({
    password: 'This is 1 strong password!',
    locale:   'en_US'
});

console.log(strongPasswordValidation.isStrong);

Here an example of a weak password check:

var strongPasswordValidation = new StrongPassword({
    password: 'Not strong',
    locale:   'en_US'
});

console.log(strongPasswordValidation.isStrong);
console.log(strongPasswordValidation.reason);

Params

  • password
  • locale ('en_US')
  • minimumLength (10)
  • minimumWords (4)
  • numbers (true)
  • lowercase (true)
  • uppercase (uppercase)
  • dictionaries (typo/dictionaries)
  • specials (/[,.?!]/g)

Only the password param is required. For the other params you see the default value in the list.

locale

With this param you can set the dictionary for the words. This will check if you only use normal words, so you can remember it.

minimumLength

With this param you can set the minimum length of the password. The default length is a total of 10 chars, including spaces.

minimumWords

With this param you can set the minimum words in the password. The default length is a total of 4 words, so the password is long, and not easy to guess.

numbers

With this param you can set that the password must have a number.

lowercase

With this param you can set that the password must have a alphabetical lowercase char.

uppercase

With this param you can set that the password must have a alphabetical uppercase char.

dictionaries

You can add another dictionary than en_US.

specials

You can define the specials that will be ignored in the words.

Test the package.

npm test

This will run all the tests in the test folder with mocha.

If you only want to check the eslint rules, just run.

npm run lint

node.js

To include strongpassword in Node, first install with npm.

npm install strongpassword

Use the package in your node files.

require('strongpassword');

install

npm i strongpassword

Downloadsweekly downloads

4

version

1.1.4

license

GPL-3.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability