Safe require package.json
This commit is contained in:
parent
efc10db664
commit
1a71a82b8f
4
index.js
4
index.js
|
@ -2,4 +2,6 @@ exports.Schema = require('./lib/schema').Schema;
|
|||
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
|
||||
exports.Validatable = require('./lib/validatable').Validatable;
|
||||
|
||||
exports.version = JSON.parse(require('fs').readFileSync('./package.json')).version;
|
||||
try {
|
||||
exports.version = require('./package.json').version;
|
||||
} catch(e) {}
|
||||
|
|
Loading…
Reference in New Issue