1.1.1 • Published 2 years ago

random-generated-password v1.1.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

random-generated-password - NPM package to generate configurable passwords

GitHub GitHub package.json version npm

Installation

npm i random-generated-password

The library has 7 options to generate a password:

  • alphabet
    • Use all lowercase letters of the alphabet
  • alphabetUpper
    • Use all the letters of the alphabet in uppercase
  • alphabetaAll
    • Use all letters of the alphabet in upper and lower case
  • numeric
    • Use all the numbers from 0 to 9
  • alphanumeric
    • Uses all uppercase and lowercase letters of the alphabet and all numbers from 0 to 9
  • characters
    • Uses all the characters from the list below
  • all
    • Uses all uppercase and lowercase letters of the alphabet, all numbers from 0 to 9 and all special characters

Usage example with default characters

import { generatePassword } from 'random-generated-password';

const pass = generatePassword({ size: 20, type: 'all' });

console.log(pass); // outpud: >HV_S:Cv9UBY^*PO#:k;

Usage example with custom characters

import { generatePassword } from 'random-generated-password';

const pass = generatePassword({ size: 20, type: 'all', mySpecialCharacters: '&%&$_--][!}{--_$&%&' /* optional */ });

console.log(pass); // outpud: ZT}hoDksb&knF%k2-4_I