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:
authorForrest L Norvell <forrest@npmjs.com>2014-10-24 10:12:19 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-10-31 11:18:12 +0300
commit7719cfdd8b204dfeccc41289707ea58b4d608905 (patch)
treed3638e35e4988a9ed789ad74ed4b5418fecb2255 /lib/search.js
parent20a331ced6a52faac6ec242e3ffdf28bcd447c40 (diff)
use new npm-registry-client API
Makes a *lot* clearer when the CLI is doing something with auth implications, by explicitly pass auth to registry client. Moves lookup of credentials into mapRegistryToURI, which makes the code more consistent.
Diffstat (limited to 'lib/search.js')
-rw-r--r--lib/search.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/search.js b/lib/search.js
index 5dd060f82..d2ce9a3c0 100644
--- a/lib/search.js
+++ b/lib/search.js
@@ -2,8 +2,7 @@
module.exports = exports = search
var npm = require("./npm.js")
- , registry = npm.registry
- , columnify = require('columnify')
+ , columnify = require("columnify")
, mapToRegistry = require("./utils/map-to-registry.js")
search.usage = "npm search [some search terms ...]"
@@ -58,15 +57,16 @@ function search (args, silent, staleness, cb) {
}
function getFilteredData (staleness, args, notArgs, cb) {
- var opts = {
- timeout : staleness,
- follow : true,
- staleOk : true
- }
- mapToRegistry("-/all", npm.config, function (er, uri) {
+ mapToRegistry("-/all", npm.config, function (er, uri, auth) {
if (er) return cb(er)
- registry.get(uri, opts, function (er, data) {
+ var params = {
+ timeout : staleness,
+ follow : true,
+ staleOk : true,
+ auth : auth
+ }
+ npm.registry.getAll(uri, params, function (er, data) {
if (er) return cb(er)
return cb(null, filter(data, args, notArgs))
})