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.
function homedir(username) {
  return username ? path.resolve(path.dirname(home), username) : home;
}