Skip to content

Commit

Permalink
Merge pull request #6 from PayU/release-fix
Browse files Browse the repository at this point in the history
fix: package.json fix for release
  • Loading branch information
ilan-kushnir-payu-gpo authored Nov 24, 2024
2 parents 5554935 + 32f4c8e commit 3d0787b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @payu/zxcvbn-custom-matchers

The package is adding custom matchers to the zxcvbn-ts package. The matchers enforce specific character requirements in passwords and provide feedback and scoring.

## Installation
```sh
npm install @payu/zxcvbn-custom-matchers
Expand All @@ -8,15 +10,49 @@ npm install @payu/zxcvbn-custom-matchers
### Usage
```ts
import { zxcvbnOptions } from '@zxcvbn-ts/core';
import { firstMatcher, secondMatcher } from '@payu/my-package';
import {
lowercaseMatcher,
numberMatcher,
specialMatcher,
uppercaseMatcher
} from '@payu/zxcvbn-custom-matchers';

// Add the matchers
zxcvbnOptions.addMatcher('first', firstMatcher);
zxcvbnOptions.addMatcher('second', secondMatcher);
zxcvbnOptions.addMatcher('lowercaseMatcher', lowercaseMatcher);
zxcvbnOptions.addMatcher('numberMatcher', numberMatcher);
zxcvbnOptions.addMatcher('specialMatcher', specialMatcher);
zxcvbnOptions.addMatcher('uppercaseMatcher', uppercaseMatcher);

// Use zxcvbn as usual
import { zxcvbn } from '@zxcvbn-ts/core';
const result = zxcvbn('password123');
console.log(result);
```

## Matchers Description

This project includes several matchers that enforce specific character requirements in passwords. Each matcher checks for a particular type of character and provides feedback and scoring.

### Uppercase Matcher

- **Purpose**: Ensures the password contains at least one uppercase letter.
- **Feedback**: Suggests including at least one uppercase letter if missing.
- **Scoring**: Returns a score of `-100` if missing uppercase letters.

### Lowercase Matcher

- **Purpose**: Ensures the password contains at least one lowercase letter.
- **Feedback**: Suggests including at least one lowercase letter if missing.
- **Scoring**: Returns a score of `-100` if missing lowercase letters.

### Number Matcher

- **Purpose**: Ensures the password contains at least one number.
- **Feedback**: Suggests including at least one number if missing.
- **Scoring**: Returns a score of `-100` if missing numbers.

### Special Character Matcher

- **Purpose**: Ensures the password contains at least one special character (e.g., !, @, #, $, etc.).
- **Feedback**: Suggests including at least one special character if missing.
- **Scoring**: Returns a score of `-100` if missing special characters.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/PayU/zxcvbn-custom-matchers.git"
"url": "git+https://github.com/PayU/zxcvbn-custom-matchers.git"
},
"keywords": [
"zxcvbn"
Expand Down

0 comments on commit 3d0787b

Please sign in to comment.