Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-04-13 23:10:43 +0400
committerisaacs <i@izs.me>2011-04-13 23:10:43 +0400
commit1a011677cb460ff61b63f7933b3659b59b883c87 (patch)
tree29812f1913fd654b90f1b1c1ae1ae5b384fac973 /lib/whoami.js
parent8d77a8a2935e0150d670d7dda59168a41d54d584 (diff)
add npm whoami
You're welcome, @visionmedia
Diffstat (limited to 'lib/whoami.js')
-rw-r--r--lib/whoami.js13
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)
+}