Used to detect what type of stream should be used with a given file descriptor. Usually this will be used during initialization to guess the type of the stdio streams.
For isatty(3) equivalent functionality use this function and test for UV_TTY.
Returns the current high-resolution real time. This is expressed in nanoseconds. It is relative to an arbitrary time in the past. It is not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals.
Note: Not every platform can support nanosecond resolution; however, this value will always be in nanoseconds.
Many of the functions below are not thread safe and might block. Functions like cwd are useful nevertheless, if you target windows. Unlike Sys.getcwd() they return UTF8-encoded names
Gets the current user's home directory. On Windows, homedir first checks the USERPROFILE environment variable using GetEnvironmentVariableW(). If USERPROFILE is not set, GetUserProfileDirectoryW() is called.
On all other operating systems, os_homedir first checks the HOME environment variable using getenv(3). If HOME is not set, getpwuid_r(3) is called.
Gets the temp directory. On Windows, uv_os_tmpdir() uses GetTempPathW(). On all other operating systems, uv_os_tmpdir() uses the first environment variable found in the ordered list TMPDIR, TMP, TEMP, and TEMPDIR. If none of these are found, the path "/tmp" is used, or, on Android, "/data/local/tmp" is used.
putenv ~key ~data sets the value associated to a variable in the process environment. key is the name of the environment variable, and data its new associated value.