UNPKG

556 BJavaScriptView Raw
1// turns out tagging isn't very complicated
2// all the smarts are in the couch.
3module.exports = tag
4tag.usage = "npm tag <project>@<version> [<tag>]"
5
6tag.completion = require("./unpublish.js").completion
7
8var npm = require("./npm.js")
9 , registry = npm.registry
10
11function tag (args, cb) {
12 var thing = (args.shift() || "").split("@")
13 , project = thing.shift()
14 , version = thing.join("@")
15 , t = args.shift() || npm.config.get("tag")
16 if (!project || !version || !t) return cb("Usage:\n"+tag.usage)
17 registry.tag(project, version, t, cb)
18}