Get version
This commit is contained in:
parent
41b4ded78c
commit
7f359c808e
6
index.js
6
index.js
|
@ -1,11 +1,13 @@
|
|||
var fs = require('fs');
|
||||
|
||||
exports.Schema = require('./lib/schema').Schema;
|
||||
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
|
||||
exports.Validatable = require('./lib/validatable').Validatable;
|
||||
|
||||
try {
|
||||
if (process.versions.node < '0.6' || true) {
|
||||
exports.version = JSON.parse(fs.readFileSync(process.cwd() + '/package.json')).version;
|
||||
exports.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version;
|
||||
} else {
|
||||
exports.version = require('../package').version;
|
||||
}
|
||||
} catch(e) {}
|
||||
} catch (e) {}
|
||||
|
|
Loading…
Reference in New Issue