diff --git a/index.js b/index.js index 6e622d8a..62dd4ea1 100644 --- a/index.js +++ b/index.js @@ -126,7 +126,10 @@ require("./lib/montage")(gm.prototype); module.exports = exports = gm; module.exports.utils = require('./lib/utils'); module.exports.compare = require('./lib/compare')(); -module.exports.version = JSON.parse( - require('fs').readFileSync(__dirname + '/package.json', 'utf8') -).version; +var fs = require('fs'); +if (fs.readFileSync) { + module.exports.version = JSON.parse( + fs.readFileSync(__dirname + '/package.json', 'utf8') + ).version; +}