easy-password
v1.0.5
Published
An easy to use package to generate Ids.
Downloads
1
Maintainers
Readme
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
| Type | Description | |--------|----------------------------------------------------------| | all | Includes letters, integers, and symbols all into one id. | | string | Only includes letters into the id. | | int | Only includes integers into the id. | | symbol | Only includes symbols into the id. |
It will be defaulted to all if none is provided.
| Option | Description | Default | |------------|------------------------------------------------------------|---------| | startsWith | String: Choose what the password should start with. | "" | | length | Int: Pass in the length of the Id. | 1 - 20 | | amount | Int: The amount of Ids that should be generated. | 1 | | endsWith | String: Choose what the password should end with. | "" | | capitalize | Boolean: Choose if the password should be in all capitals | false | | lowerCase | Boolean: Choose if the password should be in all lowercase | false |