Skip to content

Commit

Permalink
docs: update readme for joi option
Browse files Browse the repository at this point in the history
  • Loading branch information
evanshortiss committed Sep 24, 2019
1 parent 5ffdb02 commit 9565083
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## CHANGELOG
Date format is DD/MM/YYYY

## 4.0.1 (24/09/2019)
* Remove outdated "joi" option in README

## 4.0.0 (20/09/2019)
* Update to support Joi v16.x
* No longer supports passing a Joi instance to factory
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ this repository.
```js
const Joi = require('joi')
const app = require('express')()
const validator = require('express-joi-validation').createValidator({
// You can pass a specific Joi instance using this option. By default the
// module will load the @hapi/joi version you have in your package.json
// joi: require('@hapi/joi')
})
const validator = require('express-joi-validation').createValidator({})

const querySchema = Joi.object({
name: Joi.string().required()
Expand Down Expand Up @@ -215,10 +211,7 @@ Supported options are the same as `validator.query`.
## Behaviours

### Joi Versioning
You can explicitly pass a versiong of Joi using the `joi` option supported by
the `createValidator` function.

Otherwise, this module uses `peerDependencies` for the Joi version being used.
This module uses `peerDependencies` for the Joi version being used.
This means whatever `@hapi/joi` version is in the `dependencies` of your
`package.json` will be used by this module.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-joi-validation",
"version": "4.0.0",
"version": "4.0.1",
"description": "validate express application inputs and parameters using joi",
"main": "express-joi-validation.js",
"scripts": {
Expand Down

0 comments on commit 9565083

Please sign in to comment.