Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/search.js')
-rw-r--r--lib/search.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/search.js b/lib/search.js
index e7892350c..3be8b0d27 100644
--- a/lib/search.js
+++ b/lib/search.js
@@ -1,10 +1,10 @@
module.exports = exports = search
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
, columnify = require('columnify')
+ , mapToRegistry = require("./utils/map-to-registry.js")
search.usage = "npm search [some search terms ...]"
@@ -63,10 +63,13 @@ function getFilteredData (staleness, args, notArgs, cb) {
follow : true,
staleOk : true
}
- var uri = url.resolve(npm.config.get("registry"), "-/all")
- registry.get(uri, opts, function (er, data) {
+ mapToRegistry("-/all", npm.config, function (er, uri) {
if (er) return cb(er)
- return cb(null, filter(data, args, notArgs))
+
+ registry.get(uri, opts, function (er, data) {
+ if (er) return cb(er)
+ return cb(null, filter(data, args, notArgs))
+ })
})
}