Skip to content

Commit

Permalink
doc: Update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 12, 2022
1 parent 0047133 commit e72bda3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ validate('4020810127'); // => 1 It's easy to crack!
validate(); // => 0
```

### generateMultiple

```js
import { generateMultiple } from '@wcj/generate-password';

generateMultiple(3); // => [ 'eD5$aA1$dB', 'aB2!gC1#jQ', 'aB1@dK1*mH' ]
generateMultiple(2, { length: 8 }); // => [ 'fJ4@kF3,', 'aE0%gP0;' ]
```

## Options

```ts
Expand Down Expand Up @@ -102,8 +93,14 @@ export declare function generate(opts?: Option): string;
export declare function generateMultiple(length?: number, opts?: Option): string[];
/**
* symbols pass with lowercase and uppercase letters, numbers and special characters
* @return [0~4]
*
* `4` Strong :) Now it's safe!
* `3` Medium level. Enter more symbols!
* `2` Very Weak! It's easy to crack!
* `1` It's easy to crack!
*/
export declare function validate(password: string): number;
export declare function validate(password?: string): number;
```

## Development
Expand Down
4 changes: 3 additions & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
},
"keywords": [
"generate-password",
"password"
"password",
"validate",
"generate"
],
"author": "kenny wong <wowohoo@qq.com>",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export function generateMultiple(length: number = 10, opts?: Option) {

/**
* symbols pass with lowercase and uppercase letters, numbers and special characters
* @return [0~4]
*
* `4` Strong :) Now it's safe!
* `3` Medium level. Enter more symbols!
* `2` Very Weak! It's easy to crack!
* `1` It's easy to crack!
*/
export function validate(password: string = '') {
// Create an array and push all possible values that you want in password
Expand Down

0 comments on commit e72bda3

Please sign in to comment.