From 7f359c808eb3b3295dde83a28a8ab53b936fdffd Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Thu, 26 Jan 2012 13:36:14 +0400 Subject: [PATCH] Get version --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a2474f7b..dd9f57f7 100644 --- a/index.js +++ b/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) {}