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.Schema = require('./lib/schema').Schema;
|
||||||
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
|
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
|
||||||
exports.Validatable = require('./lib/validatable').Validatable;
|
exports.Validatable = require('./lib/validatable').Validatable;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (process.versions.node < '0.6' || true) {
|
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 {
|
} else {
|
||||||
exports.version = require('../package').version;
|
exports.version = require('../package').version;
|
||||||
}
|
}
|
||||||
} catch(e) {}
|
} catch (e) {}
|
||||||
|
|
Loading…
Reference in New Issue