Update version reading

This commit is contained in:
Anatoliy Chakkaev 2012-01-20 13:01:24 +04:00
parent 66e84ba6bb
commit 23743993a9
1 changed files with 5 additions and 1 deletions

View File

@ -3,5 +3,9 @@ exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
exports.Validatable = require('./lib/validatable').Validatable;
try {
exports.version = require('./package.json').version;
if (process.versions.node < '0.6' || true) {
exports.version = JSON.parse(fs.readFileSync(process.cwd() + '/package.json')).version;
} else {
exports.version = require('../package').version;
}
} catch(e) {}