Created
June 6, 2014 16:31
-
-
Save JoshMock/f5be51f41cb9024df6ff to your computer and use it in GitHub Desktop.
Get process's username
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUsername () { | |
var homeDir = process.env['HOME'].split('/'); | |
return homeDir[homeDir.length - 1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment