No need to use a third party module...
does it for Windows and Linux. Replace "USERNAME" with "USER" for Mac.
username:String=getenv_("USERNAME")
does it for Windows and Linux. Replace "USERNAME" with "USER" for Mac.