password_with_constrains

1.0.6 • Public • Published

PASSWORD GENERATOR

This pkg will be responsible to generate the random password with suppled constraints like Upper Case, Lower Case, Numeric Value etc.

Getting Started and Example

Consider the following example it's simple as that :-

const passGenerator = require('password_with_constrains');
const requiredFieldsObject = {
    upperCase: {
        required: true,
        max: 2,
        min: 1,
    },
    lowerCase: {
        required: true,
        max: 4,
        min: 1,
    },
    specialCharacter: {
        required: true,
        max: 1,
        min: 1,
    },
    numericValue: {
        required: true,
        max: 1,
        min: 1,
    },
};
const MAX_PASS_LENGTH = 9 ;
const MIN_PASS_LENGTH = 6 ;
(async () => {
    try {
        const password = await passGenerator(MIN_PASS_LENGTH, MAX_PASS_LENGTH, requiredFieldsObject)
        console.log(password)
    } catch (error) {
        console.log(error)
    }
})();

Authors

  • Parse Shyam - (https://github.com/parseshyam)

Package Sidebar

Install

npm i password_with_constrains

Weekly Downloads

2

Version

1.0.6

License

ISC

Unpacked Size

11.7 kB

Total Files

4

Last publish

Collaborators

  • shyam_parse