Mimic, replace or work around removed npm utils.

This commit is contained in:
Marcel Klehr 2012-10-28 18:34:20 +01:00
parent e447a6fade
commit 78e64ffea8
4 changed files with 24 additions and 7 deletions

View file

@ -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
}