1 | module.exports = whoami
|
2 |
|
3 | var npm = require("./npm.js")
|
4 |
|
5 | whoami.usage = "npm whoami\n(just prints the 'username' config)"
|
6 |
|
7 | function whoami (args, silent, cb) {
|
8 | if (typeof cb !== "function") cb = silent, silent = false
|
9 | var me = npm.config.get("username")
|
10 | msg = me ? me : "Not authed. Run 'npm adduser'"
|
11 | if (!silent) console.log(msg)
|
12 | process.nextTick(cb.bind(this, null, me))
|
13 | }
|