From d1bb21fc2c00650ac86a0de688c5583f8335c37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Sun, 23 Jun 2019 22:28:12 -0500 Subject: [PATCH] doc: improve os.homedir() docs PR-URL: https://github.com/nodejs/node/pull/28401 Reviewed-By: Ben Noordhuis Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat Reviewed-By: Rich Trott Reviewed-By: James M Snell --- doc/api/os.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/api/os.md b/doc/api/os.md index 80c97e84afb14d..acd37e6a6f5b29 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -215,6 +215,14 @@ added: v2.3.0 The `os.homedir()` method returns the home directory of the current user as a string. +**POSIX**: +Will use the `$HOME` environment variable if defined. Otherwise, it will use +the [effective UID][EUID] to look up the user's home directory. + +**Windows**: +Will use the `USERPROFILE` environment variable if defined. Otherwise it +will be the path to the profile directory of the current user. + ## os.hostname()