From c22b42beca0af6323858395b3d5f847d740d3da5 Mon Sep 17 00:00:00 2001 From: Clemens Date: Thu, 11 Feb 2016 14:11:11 +0100 Subject: [PATCH] specify explicit path for `getVersion` This fixes a bug when using NPM@3. Here it's quite common that both `handy` and `to` are installed into the project's top-level `node_modules` directory. As such `getVersion` would actually access the project's package.json and not that of handy. --- lib/to.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/to.js b/lib/to.js index 2475182..680fe6e 100644 --- a/lib/to.js +++ b/lib/to.js @@ -73,5 +73,5 @@ exports.stringify = function(doc) { /* Version of this lib */ -exports.version = handy.getVersion(); +exports.version = handy.getVersion(path.join(__dirname, '..'));