index.js
function homedir(username) {
  return username ? path.resolve(path.dirname(home), username) : home;
}
function homedir(username) {
  return username ? path.resolve(path.dirname(home), username) : home;
}
Resolves the path to the user's home directory.

@param {String} [username]
Username of user whose path you seek.

@return {String}
The full path to the user's home directory.