Get home directory in nodejs
You can get a user home directory with node using process.env['HOME']
at least it worked for me on osx.
Written by Thierry Le Moulec
Related protips
3 Responses
Works in linux too. process.env['USERPROFILE']
would do the same in windows.
over 1 year ago
·
Great to know thanks
over 1 year ago
·
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE
should cover all bases
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#