Socket
Book a DemoInstallSign in
Socket

@am-77/p-gen

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@am-77/p-gen

A customizable javascript password generator.

1.0.1
latest
npmnpm
Version published
Maintainers
1
Created
Source

p-gen

A customizable javascript password generator.

How to use

In the browser

Insert the p-gen.js file in the html

Download the p-gen.js file from HERE

<script src="./p-gen.js"></script>

or

Insert it directly from gtihub

<script defer src="https://raw.githubusercontent.com/AM-77/p-gen/master/p-gen.js"></script>

Use it

// create an instance of pGen Class
let pgen = new pGen()

// use the instance to access the pGen methods
let password = pgen.generatePassword(true, true, true, true, 12)

In node

Install the p-gen module

npm i @am-77/p-gen

or

yarn add @am-77/p-gen

Use it

const pGen = require("@am-77/p-gen")
let pgen = new pGen()

let password = pgen.generatePassword(true, true, true, true, 12)

Available Methods

  • generatePassword(lowercase:optional = true, uppercase:optional = true, numbers:optional = true, symbols:optional = true, length:optional = 12)

    • lowercase : set it to true if the password should contains lowercase or false otherwise, true by default.
    • uppercase : set it to true if the password should contains uppercase or false otherwise, true by default.
    • numbers : set it to true if the password should contains numbers or false otherwise, true by default.
    • symbols : set it to true if the password should contains symbols or false otherwise, true by default.
    • length : the length of the password equals 12 by default
  • generatePasswordWithChars(chars, length:optional = 12)

    • chars : a string of the characters that must be used to generate the password.
    • length : the length of the password equals 12 by default
  • generateLowercase(length)

  • generateUppercase(length)

  • generateNumbers(length)

  • generateSymbols(length)

Demo

You can check the live demo here : p-gen Demo

Contribution

Feel free to raise an issue or submit a pull request.

Code copyright 2019 AM-77. Code released under the MIT license.

Keywords

javascript

FAQs

Package last updated on 05 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.