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/docs.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/docs.js')
-rw-r--r--lib/docs.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/docs.js b/lib/docs.js
index dead3f755..3abeda7e2 100644
--- a/lib/docs.js
+++ b/lib/docs.js
@@ -5,10 +5,10 @@ docs.usage += "\n"
docs.usage += "npm docs ."
docs.completion = function (opts, cb) {
- mapToRegistry("/-/short", npm.config, function (er, uri) {
+ mapToRegistry("/-/short", npm.config, function (er, uri, auth) {
if (er) return cb(er)
- registry.get(uri, { timeout : 60000 }, function (er, list) {
+ npm.registry.get(uri, { timeout : 60000, auth : auth }, function (er, list) {
return cb(null, list || [])
})
})
@@ -57,10 +57,10 @@ function getDoc (project, cb) {
return opener(url(json), { command: npm.config.get("browser") }, cb)
}
- mapToRegistry(project, npm.config, function (er, uri) {
+ mapToRegistry(project, npm.config, function (er, uri, auth) {
if (er) return cb(er)
- registry.get(uri + "/latest", { timeout : 3600 }, next)
+ npm.registry.get(uri + "/latest", { timeout : 3600, auth : auth }, next)
})
function next (er, json) {