diff options
author | isaacs <i@izs.me> | 2011-04-13 23:10:43 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-04-13 23:10:43 +0400 |
commit | 1a011677cb460ff61b63f7933b3659b59b883c87 (patch) | |
tree | 29812f1913fd654b90f1b1c1ae1ae5b384fac973 /lib/whoami.js | |
parent | 8d77a8a2935e0150d670d7dda59168a41d54d584 (diff) |
add npm whoami
You're welcome, @visionmedia
Diffstat (limited to 'lib/whoami.js')
-rw-r--r-- | lib/whoami.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/whoami.js b/lib/whoami.js new file mode 100644 index 000000000..c3931f938 --- /dev/null +++ b/lib/whoami.js @@ -0,0 +1,13 @@ +module.exports = whoami + +var npm = require("../npm") + , output = require("./utils/output") + , log = require("./utils/log") + +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) +} |