diff options
author | Forrest L Norvell <ogd@aoaioxxysz.net> | 2015-01-08 14:37:26 -0800 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-08 23:49:03 +0100 |
commit | e79ccee1685393e4ec73746bac93835cbcf3a809 (patch) | |
tree | 304a1ddd59495b50a20d1b25c62da2a4519228db /deps/npm/lib/view.js | |
parent | 156cd82ef4d2ff4fa291407de562c3a7c2386dc7 (diff) | |
download | android-node-v8-e79ccee1685393e4ec73746bac93835cbcf3a809.tar.gz android-node-v8-e79ccee1685393e4ec73746bac93835cbcf3a809.tar.bz2 android-node-v8-e79ccee1685393e4ec73746bac93835cbcf3a809.zip |
npm: upgrade to v2.1.18
PR-URL: https://github.com/iojs/io.js/pull/266
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/npm/lib/view.js')
-rw-r--r-- | deps/npm/lib/view.js | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 6b45cca2ec..bd20ab5a3f 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -3,20 +3,29 @@ module.exports = view view.usage = "npm view pkg[@version] [<field>[.subfield]...]" +var npm = require("./npm.js") + , readJson = require("read-package-json") + , log = require("npmlog") + , util = require("util") + , semver = require("semver") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , path = require("path") + view.completion = function (opts, cb) { if (opts.conf.argv.remain.length <= 2) { - return mapToRegistry("-/short", npm.config, function (er, uri) { + return mapToRegistry("-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, cb) + npm.registry.get(uri, { auth : auth }, cb) }) } // have the package, get the fields. var tag = npm.config.get("tag") - mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri) { + mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, d) { + npm.registry.get(uri, { auth : auth }, function (er, d) { if (er) return cb(er) var dv = d.versions[d["dist-tags"][tag]] , fields = [] @@ -48,16 +57,6 @@ view.completion = function (opts, cb) { } } -var npm = require("./npm.js") - , readJson = require("read-package-json") - , registry = npm.registry - , log = require("npmlog") - , util = require("util") - , semver = require("semver") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , path = require("path") - function view (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -97,10 +96,10 @@ function fetchAndRead (nv, args, silent, cb) { var name = nv.name , version = nv.rawSpec || npm.config.get("tag") - mapToRegistry(name, npm.config, function (er, uri) { + mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, data) { + npm.registry.get(uri, { auth : auth }, function (er, data) { if (er) return cb(er) if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { version = data["dist-tags"][version] |