README
validationHelper-password
a validation package for Node.js.
Main function is providing different level of password validation.
Installation and Usage
Install
npm install --save validationhelper-password
Usage
const validationHelper = require('validationhelper-password');
Example
let value = 'abc';
console.log((validationHelper.isEmpty(value)))//=>false;
let password = '111112A';
let min = 2;
let max = 10;
console.log(validationHelper.passwordQuality.isLowQuality(password,min,max))//=>true;
Function
All function are listed below:
Validation | Description |
---|---|
isEmpty(parameter) | check if the parameter is empty. |
isLowQuality(password, min, max) | check if the password contains at least one of number, uppercase letter or lowercase letter. (1a, 1A, aA) |
isHighQuality(password, min, max) | check if the password contains at least one number, one uppercase letter, one lowercase letter. (1aA) |
isSuperQuality(password, min, max) | check if the password contains at least one number, one uppercase letter, one lowercase letter and one symbol. (1aA#) |
isTime(time) | check if the time format is HH:mm. (23:00) |
isDate(date) | check if the date format is YYYY-MM-DD. (2018-10-20) |
Contributing
In general, this project follow the "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine
- Work on your fork
- Make your changes and additions
- Change or add tests if needed
- Add changes to README.md if needed
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request and waiting to be accepted