Skip to content

Commit

Permalink
pass info on up from npm ls
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Oct 27, 2010
1 parent 178753a commit 2b430a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ls.js
Expand Up @@ -10,14 +10,16 @@ var npm = require("../npm")

ls.usage = "npm ls [some search terms ...]"

function ls (args, cb) {
function ls (args, cb_) {
readInstalled([], function (er, installed) {
if (er) return cb(er)
registry.get(function (er, remote) {
if (er) remote = {}
var pretty = prettify(merge(installed, remote), args)
var info = merge(installed, remote)
, pretty = prettify(info, args)
, stdout = process.stdout
stdout.write(pretty)
function cb () { cb_(null, info) }
if (stdout.flush()) cb()
else stdout.on("drain", cb)
})
Expand Down

0 comments on commit 2b430a6

Please sign in to comment.