Skip to content

This is package which lets you generate random passwords with options like, length and should it contain: numbers / letters / speacial chars.

License

Notifications You must be signed in to change notification settings

shreyazz/random-pass-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Random-Pass-Package

This is package which lets you generate random passwords with options like, length and should it contain: numbers / letters / special chars.

Installation and Importing

  1. Install the package
npm i @shreyazz/random_pass
  1. Import package
const randomPass = require("@shreyazz/random_pass");

or

import randomPass from "@shreyazz/random_pass";

Functions

There are two functions in the package. (Here I'm assuming that the package is imported in randomPass variable)

  • .info()
  • .generateRandomPass()
  1. randomPass.info() It console logs the information about the package and how to use it.

  2. randomPass.generateRandomPass() This function takes one parameter, an object. That object contains two properties. Length (Length of the password) and shouldContain (array of things you want to include in the password like, numbers or special chars)

    const password = randomPass.generateRandomPass({
      length: 10,
      shouldContain: ["numbers", "letters", "spl-chars"],
    });

Stuff to know before usage.

  • shouldContain array must have at least two options.
  • To include:
    • Letters: letters
    • Numbers: numbers,
    • Speacial Characters: spl-chars

Example: If I want to include only Numbers and Special Characters

const password = randomPass.generateRandomPass({
  length: 5,
  shouldContain: ["numbers", "spl-chars"],
});

Made with ❤️ by Shreyas Pahune

About

This is package which lets you generate random passwords with options like, length and should it contain: numbers / letters / speacial chars.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published