0.3.0 • Published 5 years ago

password-validator-minimalist v0.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Password Validator Minimalist

Validates custom text or desired password with simple options

Build Status

npm.io

Installation

npm install password-validator-minimalist --save

Usage example

Import Validator

const validator = require('./index');

Import Validator (EcmaScript 6)

import validator from 'password-validator-minimalist';

Use Validator

let valid = validator.validate('custom@Password123', {
    lowercase: true,
    uppercase: true,
    number: true,
    specialChar: true
}, 10);

console.log(valid)

Second argument - Available Options Object

Any of these can be passed into the arguments object for each instance.

OptionDescriptionDefault Value
lowercaseBoolean, check for uppercase lettersnull
uppercaseBoolean, check for uppercase lettersnull
numberBoolean, check for numeric lettersnull
specialCharBoolean, check for special chars (symbols)null

Third argument - Minimum length

  • By default is 10 chars

Meta

Distributed under the XYZ license. See LICENSE for more information.

https://github.com/MGSousa/password-validator