Skip to content

Commit 1e045e9

Browse files
committed
Add version number to the joi instance
1 parent 9f6fb73 commit 1e045e9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

API.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!-- toc -->
88

99
- [Joi](#joi)
10+
- [`version`](#version)
1011
- [`validate(value, schema, [options], [callback])`](#validatevalue-schema-options-callback)
1112
- [`compile(schema)`](#compileschema)
1213
- [`assert(value, schema, [message])`](#assertvalue-schema-message)
@@ -134,6 +135,10 @@
134135

135136
## Joi
136137

138+
### `version`
139+
140+
Property showing the current version of joi being used.
141+
137142
### `validate(value, schema, [options], [callback])`
138143

139144
Validates a value using the given schema and options where:

lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ internals.root = function () {
347347
}).or('setup', 'validate'))
348348
})).strict();
349349

350+
root.version = require('../package.json').version;
351+
350352
return root;
351353
};
352354

0 commit comments

Comments
 (0)