summaryrefslogtreecommitdiff
path: root/src/static/js/pluginfw/read-installed.js
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2012-10-28 18:34:20 +0100
committerMarcel Klehr <mklehr@gmx.net>2012-10-28 18:34:20 +0100
commit78e64ffea8b97be6a0b9267e22334713b297236a (patch)
treeae6eb628b27dc181017461b9a754ba3f55ef3fc4 /src/static/js/pluginfw/read-installed.js
parente447a6fade15ed2df53fef3e5845c134232306b8 (diff)
downloadetherpad-lite-78e64ffea8b97be6a0b9267e22334713b297236a.zip
Mimic, replace or work around removed npm utils.
Diffstat (limited to 'src/static/js/pluginfw/read-installed.js')
-rw-r--r--src/static/js/pluginfw/read-installed.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/static/js/pluginfw/read-installed.js b/src/static/js/pluginfw/read-installed.js
index cc03b357..800ee32c 100644
--- a/src/static/js/pluginfw/read-installed.js
+++ b/src/static/js/pluginfw/read-installed.js
@@ -94,8 +94,21 @@ var npm = require("npm/lib/npm.js")
, path = require("path")
, asyncMap = require("slide").asyncMap
, semver = require("semver")
- , readJson = require("npm/lib/utils/read-json.js")
- , log = require("npm/lib/utils/log.js")
+ , log = require("log4js").getLogger('pluginfw')
+
+function readJson(file, callback) {
+ fs.readFile(file, function(er, buf) {
+ if(er) {
+ callback(er);
+ return;
+ }
+ try {
+ callback( null, JSON.parse(buf.toString()) )
+ } catch(er) {
+ callback(er)
+ }
+ })
+}
module.exports = readInstalled
@@ -274,7 +287,7 @@ function findUnmet (obj) {
}
})
- log.verbose([obj._id], "returning")
+ log.debug([obj._id], "returning")
return obj
}