1.0.5 • Published 3 years ago

easy-password v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

About

easy-password is an easy to use package to generate strong passwords. It will generate them based on the length and type you provided.

Simple and easy to use.

Table of Contents:

Changelog

Version 1.0.0 is the first version of easy-password. Please read through the README to find out more.

The type is now also not inside the object anymore.

Example

Before you begin, please install the package with:

npm i easy-password

Or with yarn:

yarn add easy-password

Next, you need to import the package:

const PASS = require('easy-password');

Or:

import PASS from 'easy-password';

After that, you're almost ready to go.

Examples to generate an Id:

const PASS = require('easy-password');

const password = new PASS();

console.log(password.generate("all", {length: 10})) //--> -=1cP--OJ+

console.log(password.generate("string", {length: 10})) //--> EfBgSGgEHp

console.log(password.generate("int", {length: 10}))  //--> 4256080813

console.log(password.generate("symbol", {length: 10}))  //--> ^*$%#-#!%#

Generate multiple Ids:

const PASS = require('easy-password');

const password = new password();

console.log(password.generate("all", {length: 10, amount: 2})) //--> [ 'af!95chluZ', 'hgyQq*HwpW' ]

Lowercase and Uppercase passwords:

const PASS = require('easy-password');

const password = new password();

console.log(password.generate("all", {length: 10,  lowerCase: true})) //--> z#gs#voa#r

console.log(password.generate("all", {length: 10, capitalize: true})) //--> AH3$1F#BAA

Options

TypeDescription
allIncludes letters, integers, and symbols all into one id.
stringOnly includes letters into the id.
intOnly includes integers into the id.
symbolOnly includes symbols into the id.

It will be defaulted to all if none is provided.

OptionDescriptionDefault
startsWithString: Choose what the password should start with.""
lengthInt: Pass in the length of the Id.1 - 20
amountInt: The amount of Ids that should be generated.1
endsWithString: Choose what the password should end with.""
capitalizeBoolean: Choose if the password should be in all capitalsfalse
lowerCaseBoolean: Choose if the password should be in all lowercasefalse