Skip to content

Commit

Permalink
Merge pull request #55 from Adoliin/patch-1
Browse files Browse the repository at this point in the history
Add syntax highlighting to code snippets
  • Loading branch information
Maxime Dupont authored Dec 13, 2021
2 parents 94ea916 + b9d4c09 commit 961e443
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A simple way to check that password strength of a certain passphrase. A password
`npm i check-password-strength --save`

## Setup & Basic Usage
```
```javascript
const { passwordStrength } = require('check-password-strength')
// OR
import { passwordStrength } from 'check-password-strength'
Expand All @@ -34,15 +34,15 @@ console.log(passwordStrength('A@2asdF2020!!*').value)
```
## Migration from 1.x.x to 2.0.0

```
```javascript
// 1.x.x
const whateEverYourFunctionNameWasBefore = require("./index");

// 'contains' attribute of the response object format was
response.contains = [{'message': 'lowercase'}, ...]
```

```
```javascript
// 2.0.0
const { passwordStrength : whateEverYourFunctionNameWasBefore } = require("./index");

Expand All @@ -67,7 +67,7 @@ response.contains = ['lowercase', ...]
| Medium | 4 | 8 |
| Strong | 4 | 10 |

```
```javascript
console.log(passwordStrength('@Sdfasd2020!@#$'))
// output
{
Expand All @@ -81,12 +81,12 @@ console.log(passwordStrength('@Sdfasd2020!@#$'))
### Default Options

the default options can be required:
```
```javascript
const { defaultOptions } = require("./index");
```

default options:
```
```javascript
[
{
id: 0,
Expand Down Expand Up @@ -124,7 +124,7 @@ To override the default options, simply pass your custom array as the second arg

The minDiversity and minLength parameters of the first element cannot be overriden (set to 0 at the beginning of the method). Therefore, the first element should always correspond to a "too weak" option.

```
```javascript
passwordStrength('myPassword', yourCustomOptions)
```
### RegEx
Expand Down

0 comments on commit 961e443

Please sign in to comment.