1.0.20 • Published 1 year ago

random-password-generator-by-eric v1.0.20

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Random Password Generator

npm Downloads License Minified Size

A powerful library to generate random passwords with customizable options for Node.js and TypeScript environments.

Install

npm install random-password-generator-by-eric

Usage

Start by importing the library:

const { generatePassword } = require('random-password-generator-by-eric');

Generate a password using default options:

const password = generatePassword({ length: 12 }); 
console.log(`Generated Password: ${password}`);

Customize to include uppercase, numbers, and symbols:

const customPassword = generatePassword({     
    length: 16,     
    includeUppercase: true,     
    includeNumbers: true,     
    includeSymbols: true 
});  

console.log(`Custom Generated Password: ${customPassword}`);

Features

  • Customizable Length: Specify the exact length of the password.
  • Character Inclusion Options: Choose from uppercase, numbers, and symbols to include in the password.

API

generatePassword(options)

Generates a random password based on the provided options.

Parameters:

  • options (Object):
    • length (number): Length of the password.
    • includeUppercase (boolean): Include at least one uppercase letter.
    • includeNumbers (boolean): Include at least one number.
    • includeSymbols (boolean): Include at least one symbol.

Returns:

  • (string): The generated password.

Examples

Generate a simple password:

console.log(generatePassword({ length: 8 }));

Generate a complex password:

console.log(generatePassword({     
    length: 20,     
    includeUppercase: true,     
    includeNumbers: true,     
    includeSymbols: true 
}));

License

ISC © Eric Kunin

1.0.20

1 year ago

1.0.18

1 year ago

1.0.16

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago