4 var npm = require("./npm.js")
5 , log = require("npmlog")
6 , asyncMap = require("slide").asyncMap
7 , mapToRegistry = require("./utils/map-to-registry.js")
9 star.usage = "npm star <package> [pkg, pkg, ...]\n"
10 + "npm unstar <package> [pkg, pkg, ...]"
12 star.completion = function (opts, cb) {
13 // FIXME: there used to be registry completion here, but it stopped making
14 // sense somewhere around 50,000 packages on the registry
18 function star (args, cb) {
19 if (!args.length) return cb(star.usage)
20 var s = npm.config.get("unicode") ? "\u2605 " : "(*)"
21 , u = npm.config.get("unicode") ? "\u2606 " : "( )"
22 , using = !(npm.command.match(/^un/))
24 asyncMap(args, function (pkg, cb) {
25 mapToRegistry(pkg, npm.config, function (er, uri, auth) {
32 npm.registry.star(uri, params, function (er, data, raw, req) {
34 console.log(s + " "+pkg)
35 log.verbose("star", data)
37 cb(er, data, raw, req)