1.0.3 • Published 1 year ago

passguard v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

passGuard

passGuard is a simple npm package for validating passwords against specified criteria.

Installation

You can install passGuard using npm:

npm install passguard

Usage

const passGuard = require('passguard');

// Validate password
const isValid = passGuard('StrongPass123!', 8, true, true);
console.log(isValid); // true

API

passGuard(password, minimalLength, containUpper, containSpecial)

Validates a password against specified criteria.

  • password (string): The password to validate.
  • minimalLength (number): The minimum length required for the password.
  • containUpper (boolean): Whether the password should contain at least one uppercase letter.
  • containSpecial (boolean): Whether the password should contain at least one special character.

Returns true if the password meets all the specified criteria, otherwise false.

Example

const passGuard = require('passguard');

// Validate password
const isValid = passGuard('StrongPass123!', 8, true, true);
console.log(isValid); // true

License

MIT

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago