2.1.2 • Published 2 years ago

@cityssm/simple-password-generator v2.1.2

Weekly downloads
131
License
MIT
Repository
github
Last release
2 years ago

simple-password-generator

npm Codacy Badge Maintainability Test Coverage AppVeyor Snyk Vulnerabilities for GitHub Repo

Makes generating simple or complex, appropriate passwords a breeze.

  • Passwords can have a minimum or maximum length.

  • Passwords can include words, letters, numbers, and symbols.

  • Passwords are scanned with zxcvbn-typescript to reduce their guessability.

  • Passwords are translated with unleet, and scanned using badwords to make sure they are appropriate.

Installation

npm install @cityssm/simple-password-generator

Usage

import { generatePassword } from "@cityssm/simple-password-generator";

generatePassword();
= "carPoetDRIVING%38"

generatePassword({ minLength: 15, pattern: "wnWnX" });
= "curious6COMPOSITION7B"

generatePassword({ pattern: 'xxxXXXnnns', doShufflePattern: true });
= "c0O4WG@od9"

Options

OptionDescriptionDefault
minLengthThe minimum password length.8
maxLengthThe maximum password length.50
patternThe format the password should use."wCnn"
doShufflePatternWhether the pattern should be ordered randomly or not.false
minScoreThe minimum allowable zxcvbn guessability score, where 0 is "too guessable" and 4 is "very unguessable"2
retriesThe number of times the generator should try to generate a password before failing and returning null.20

Note that if your pattern cannot generate a password within your set minLength and maxLength, the generatePassword() function may return a null value.

Pattern Options

Pattern CharacterDescriptionExample
wLower case wordword
WUpper case wordWORD
CCapitalized wordWord
xLower case lettera
XUpper case letterA
nNumber9
sSymbol@
2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.8.8

4 years ago

0.8.7

4 years ago

0.8.6

4 years ago

0.8.5

4 years ago

0.8.1

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago