Skip to content

Commit

Permalink
Add version number to the joi instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Marsup committed Nov 12, 2016
1 parent 9f6fb73 commit 1e045e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- toc -->

- [Joi](#joi)
- [`version`](#version)
- [`validate(value, schema, [options], [callback])`](#validatevalue-schema-options-callback)
- [`compile(schema)`](#compileschema)
- [`assert(value, schema, [message])`](#assertvalue-schema-message)
Expand Down Expand Up @@ -134,6 +135,10 @@

## Joi

### `version`

Property showing the current version of joi being used.

### `validate(value, schema, [options], [callback])`

Validates a value using the given schema and options where:
Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ internals.root = function () {
}).or('setup', 'validate'))
})).strict();

root.version = require('../package.json').version;

return root;
};

Expand Down

0 comments on commit 1e045e9

Please sign in to comment.