77</p >
88
99## Demo
10- Try it yourself in this ** [ CodeSandbox demo] ( https://codesandbox.io/p/github/tiavina-mika/check-password-complexity-demo ) **
11- Or
12- this ** [ Live demo] ( https://check-password-complexity.netlify.app/ ) **
10+ - ** [ CodeSandbox demo] ( https://codesandbox.io/p/github/tiavina-mika/check-password-complexity-demo ) **
11+ - ** [ Live demo] ( https://check-password-complexity.netlify.app/ ) **
1312
1413
1514## Installation
1615
1716``` shell
18-
19- npm install check-password-complexity
20-
17+ npm install check-password-complexity
2118```
2219or
2320``` shell
24-
25- yarn add check-password-complexity
21+ yarn add check-password-complexity
2622```
2723
28-
2924## Get started
3025
3126#### Simple usage
@@ -39,17 +34,17 @@ const { checkPasswordComplexity } require("check-password-complexity");
3934
4035console .log (checkPasswordComplexity (" abcdefgh" ).value ); // tooWeak
4136
42- console . log ( checkPasswordComplexity (" abcdefg8" ).value ) ; // weak
37+ checkPasswordComplexity (" abcdefg8" ).value ; // weak
4338
44- console . log ( checkPasswordComplexity (" abcdefgh9" ).value ) ; // medium
39+ checkPasswordComplexity (" abcdefgh9" ).value ; // medium
4540
46- console . log ( checkPasswordComplexity (" abcdefgh9F=" ).value ) ; // strong
41+ checkPasswordComplexity (" abcdefgh9F=" ).value ; // strong
4742
4843```
4944
5045## Result
5146
52- | property | type | Description |
47+ | Property | Type | Description |
5348| ----------------| -------------------------------| -----------------------------|
5449|value|` tooWeak, weak, medium, strong ` | Too Weak, Weak, Medium or Strong
5550|checkedRules|` (minLength, lowercase, uppercase, number, specialCharacter)[] ` | List of all checked values
@@ -58,25 +53,28 @@ console.log(checkPasswordComplexity("abcdefgh9F=").value); // strong
5853<br />
5954
6055``` tsx
61- console . log ( checkPasswordComplexity (" abcdefg" ) );
56+ checkPasswordComplexity (" abcdefg" );
6257 /**
6358 checkedRules: ['lowercase']
6459 length: 7
6560 value: "tooWeak"
6661 */
67- console .log (checkPasswordComplexity (" abcdefg8" ));
62+
63+ checkPasswordComplexity (" abcdefg8" );
6864 /**
6965 checkedRules: ['lowercase', 'number']
7066 length: 8
7167 value: "weak"
7268 */
73- console .log (checkPasswordComplexity (" abcdefgh9" ));
69+
70+ checkPasswordComplexity (" abcdefgh9" );
7471 /**
7572 checkedRules: ['minLength', 'lowercase', 'number']
7673 length: 9
7774 value: "medium"
7875 */
79- console .log (checkPasswordComplexity (" abcdefgh9F=" ));
76+
77+ checkPasswordComplexity (" abcdefgh9F=" );
8078 /**
8179 checkedRules: ['minLength', 'lowercase', 'uppercase', 'number', 'specialCharacter']
8280 length: 11
@@ -93,22 +91,26 @@ console.log(checkPasswordComplexity("abcdefgh9F=").value); // strong
9391<br />
9492
9593``` tsx
96- console . log ( checkPasswordComplexity (" abcdefg" , { minLength: 6 }) );
94+ checkPasswordComplexity (" abcdefg" , { minLength: 6 });
9795 /**
9896 checkedRules: ['minLength', 'lowercase']
9997 length: 7
10098 value: "weak"
10199 */
102100
103101 // example: "." is the special character to be allowed
104- console . log ( checkPasswordComplexity (" abcdefg." , { allowedSpecialChar: " ." }) );
102+ checkPasswordComplexity (" abcdefg." , { allowedSpecialChar: " ." });
105103 /**
106104 checkedRules: ['lowercase', 'specialCharacter']
107105 length: 8
108106 value: "weak"
109107 */
110108```
111109
110+ ## Libraries using ` check-password-complexity `
111+ - [ password-strength-input] ( https://www.npmjs.com/package/password-strength-input )
112+ - [ mui-password-strength-input] ( https://www.npmjs.com/package/mui-password-strength-input )
113+
112114## Contributing
113115Contributions & pull requests are welcome!
114116Get started [ here] ( https://github.com/tiavina-mika/check-password-complexity/blob/main/CONTRIBUTING.md ) .
0 commit comments