@adwatch/passpower

1.1.0 • Public • Published

#PassPower

Password power module

Install

$ npm install --save @adwatch/passpower

Usage

import PassPower from '@adwatch/passpower';
// or
var PassPower = require('@adwatch/passpower/build');

API

####passScore(val, minPassLength, analysis)

Get password score and return common information about it

val

Type string

minPassLength

Type number

analysis

Type array

Default []

console.log(PassPower.passScore('987654321Qq', 8, ['hasUppercase', 'hasLowercase']));

####setScorePassword(val, analyse, length)

Analyse your password and return it power

val

Type string

analyse

Type object

length

Type number

let val = '987654321Qq';

let result = {
	hasUppercase: /[A-Z]/.test(val),
	hasLowercase: /[a-z]/.test(val),
	hasDigits: /[0-9]/.test(val),
	hasSpecials: /[_\W]/.test(val)
};

console.log(PassPower.setScorePassword(val, result, 8));

License

MIT ©

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i @adwatch/passpower

    Weekly Downloads

    2

    Version

    1.1.0

    License

    ISC

    Last publish

    Collaborators

    • adwatch