summaryrefslogtreecommitdiff
path: root/deps/npm/lib/whoami.js
blob: b6e495253b9a8ec5f7419c9f1ef9430b1ad23237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
module.exports = whoami

var npm = require("./npm.js")
  , output = require("./utils/output.js")

whoami.usage = "npm whoami\n(just prints the 'username' config)"

function whoami (args, cb) {
  var me = npm.config.get("username")
  if (!me) me = "Not authed.  Run 'npm adduser'"
  output.write(me, cb)
}