Skip to content

Instantly share code, notes, and snippets.

@ianstarz
Created June 17, 2016 00:25
Show Gist options
  • Save ianstarz/cb5e6e25b3db6f85720244f8ac7d997e to your computer and use it in GitHub Desktop.
Save ianstarz/cb5e6e25b3db6f85720244f8ac7d997e to your computer and use it in GitHub Desktop.
Node function to get the user's home directory on mac and windows
module.exports = function() {
return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment