mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Mimic, replace or work around removed npm utils.
This commit is contained in:
parent
e447a6fade
commit
78e64ffea8
4 changed files with 24 additions and 7 deletions
|
@ -1,7 +1,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 registry = require("npm/lib/utils/npm-registry-client/index.js");
|
||||
var RegClient = require("npm-registry-client")
|
||||
|
||||
var registry = new RegClient(
|
||||
{ registry: "http://registry.npmjs.org"
|
||||
, cache: npm.cache }
|
||||
);
|
||||
|
||||
var withNpm = function (npmfn, final, cb) {
|
||||
npm.load({}, function (er) {
|
||||
|
@ -72,7 +77,7 @@ exports.search = function(query, cache, cb) {
|
|||
cb(null, exports.searchCache);
|
||||
} else {
|
||||
registry.get(
|
||||
"/-/all", null, 600, false, true,
|
||||
"/-/all", 600, false, true,
|
||||
function (er, data) {
|
||||
if (er) return cb(er);
|
||||
exports.searchCache = data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue