2 for each pkg in prefix that isn't a git repo
3 look for a new version of pkg that satisfies dep
8 module.exports = update
10 update.usage = "npm update [pkg]"
12 var npm = require("./npm.js")
13 , lifecycle = require("./utils/lifecycle.js")
14 , asyncMap = require("slide").asyncMap
15 , log = require("npmlog")
17 // load these, just so that we know that they'll be available, in case
18 // npm itself is getting overwritten.
19 , install = require("./install.js")
20 , build = require("./build.js")
22 update.completion = npm.commands.outdated.completion
24 function update (args, cb) {
25 npm.commands.outdated(args, true, function (er, outdated) {
26 log.info("outdated", "updating", outdated)
29 asyncMap(outdated, function (ww, cb) {
30 // [[ dir, dep, has, want, req ]]
34 , what = dep + "@" + want
36 , url = require('url')
38 // use the initial installation method (repo, tar, git) for updating
39 if (url.parse(req).protocol) what = req
40 npm.commands.install(where, what, cb)