A generator that creates random values, including letters, numbers and special characters. You can generate passwords or special codes with this!
You can install this package using npm
:
npm i rcharacter-generator
# Or with Yarn!
yarn add rcharacter-generator
import generate from 'rcharacter-generator';
This function recieves two params: a lenght param as an int
, and an optional object
with the different options for the generator:
generate(10)
// Generates a string of lowercase values
The options
param can recieve the following values:
- lowercaseLetters
- uppercaseLetters
- numbers
- specialSymbols
generate(10, { lowercaseLetters: true, uppercaseLetters: true });
// Generates a string of lowercase and uppercase values
generate(10, { lowercaseLetters: true, uppercaseLetters: true, numbers: true });
// Generates a string of lowercase, uppercase and number values
generate(10, { lowercaseLetters: true, uppercaseLetters: true, numbers: true, specialSymbols: true});
// Generates a string of all possible values: uppercase, lowercase, numbers and special symbols
If you find any issues, please head over to the issues and I'll try to see what I can do
Do you have an idea of how to improve this project? Head over to discussions section and share your ideas!