Skip to content

This package will generate a random string with params

Notifications You must be signed in to change notification settings

0x4bd0/randomstringsgenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

randomstringsgenerator

This package will generate a random string with params, for example you can use this package to generate passwords.

Getting started :

npm i randomstringsgenerator

Or

yarn add randomstringsgenerator

Next we import it

const rsg = require('randomstringsgenerator')

How to use:

The packge accepts 2 inputs, if you call the generator without passing any params,
it will return a random string including lowerCase and numbers only, with the length of 10 chars.

Inputs :

1- length => a number, represents the length of the string.
2- params => Array [] accepts the following strings ['upperCase', 'lowerCase', 'specialChars', 'numbers'].

rsg(length,params)

Example

If i want a random string including uppercase, lowercase, special characters and numbers, with a length of 15

rsg(15,['numbers','upperCase','lowerCase','specialChars'])