Get version

This commit is contained in:
Anatoliy Chakkaev 2012-01-26 13:36:14 +04:00
parent 41b4ded78c
commit 7f359c808e
1 changed files with 4 additions and 2 deletions

View File

@ -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) {}