Don't leak event listeners in pluginfw/installer.js

fixes #921
pull/1672/head
Marcel Klehr 2013-03-25 17:22:51 +01:00
parent 079fdf0f38
commit 1ebbcd2f30
1 changed files with 4 additions and 1 deletions

View File

@ -2,9 +2,12 @@ var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
var npm = require("npm");
var withNpm = function (npmfn, cb) {
var npmIsLoaded = false;
var withNpm = function (npmfn) {
if(npmIsLoaded) return npmfn();
npm.load({}, function (er) {
if (er) return cb(er);
npmIsLoaded = true;
npm.on("log", function (message) {
console.log('npm: ',message)
});