diff options
author | isaacs <i@izs.me> | 2010-12-27 09:48:53 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-12-27 09:48:53 +0300 |
commit | 429c0eb956a5a620d5f3638e57e94f50045704d0 (patch) | |
tree | 57ebee2d2daf9a05e9d3c245abdf6b2ff8955083 | |
parent | 9a914d2991df051c2b717d75e4247d10b51927e8 (diff) |
Process data coming out of registry
-rw-r--r-- | lib/outdated.js | 7 | ||||
-rw-r--r-- | lib/utils/registry/get.js | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index 77a47e756..7a154db07 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -29,6 +29,7 @@ var readInstalled = require("./utils/read-installed") , lifecycle = require("./utils/lifecycle") , asyncMap = require("./utils/async-map") , output = require("./utils/output") + , readJson = require("./utils/read-json") function outdated (args, silent, cb) { if (typeof silent === "function") cb = silent, silent = false @@ -56,7 +57,7 @@ function findUpdates (args, cb) { var tag = npm.config.get("tag") asyncMap(Object.keys(inst), function (pkg, cb) { log.verbose(pkg, "find updates") - registry.get(pkg, function (er, data) { + registry.get(pkg, readJson.processJson({}, function (er, data) { if (er) return log.verbose(pkg, "not in registry", cb) var latest = data["dist-tags"] && data["dist-tags"][tag] , have = Object.keys(inst[pkg]).sort(semver.sort) @@ -68,7 +69,7 @@ function findUpdates (args, cb) { }).sort(semver.sort) , highest = available[ available.length - 1 ] if (!data.versions[latest]) latest = highest - log.verbose(latest, pkg+"@latest") + log.verbose(latest||"none", pkg+"@latest") log.verbose(minHave, pkg+" min installed") log.verbose(semver.gt(latest, minHave), pkg+" latest > minHave") // check if we have the latest already @@ -81,7 +82,7 @@ function findUpdates (args, cb) { , pkg : data.versions[latest] , name : data.name }) - }) + })) }, cb) }) } diff --git a/lib/utils/registry/get.js b/lib/utils/registry/get.js index b66050d28..c130bd1a9 100644 --- a/lib/utils/registry/get.js +++ b/lib/utils/registry/get.js @@ -41,7 +41,7 @@ function get_ (uri, timeout, cache, stat, data, nofollow, cb) { } GET(uri, etag, nofollow, function (er, remoteData, raw, response) { if (response) { - log.verbose([response.statusCode, response.headers], "get cb") + log.silly([response.statusCode, response.headers], "get cb") if (response.statusCode === 304 && etag) { remoteData = data log.verbose("from cache", "etag") |