1.0.6 • Published 3 years ago

ts-password-generator v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Password Generator Module

A little module to generate password, use fromCharCode() static method to convert a random "ASCII - Unicode" code to a readable character.

String.fromCharCode()

Feel free to use it, if you like it! :D

Ready to use

Just npm install ts-password-generator, then

import { generator } from 'ts-password-generator';

const password: string = generator({ haveNumbers: true })

or

const tsPasswordGenerator = require("ts-password-generator");

const tsPass = tsPasswordGenerator;

tsPass.generator({});

and you are ready to go.

The generator method receive following optional params:

{
    charsQty: number,
    isUppercase: boolean,
    haveNumbers: boolean,
    haveString: boolean,
    haveSymbols: boolean
}

and returns a brand new password string.

Accepted params by generator method

Any of these can be passed into the options object for generator method.

NameDescriptionDefault Value
charsQtyInteger, optional param, password length (chars quantity).10
isUppercaseBoolean, optional param, add uppercase chars to the generated password.false
haveNumbersBoolean, optional param, add numbers to the generated password.false
haveStringBoolean, optional param, add char to the generated password.true
haveSymbolsBoolean, optional param, add symbols (special characters) to the generated passwordfalse

NOTE: by default, if you don't pass any parameter to the generator method, the generated password will be in lowercase.

TODO

  • Add maybe more fuctionality.

DONE

  • Make this little script an npm package just for fun, and educative purposes.
  • Added more documentation.
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago