Function userInfo

  • Returns information about the currently effective user. On POSIX platforms, this is typically a subset of the password file. The returned object includes the username, uid, gid, shell, and homedir. On Windows, the uid andgid fields are -1, and shell is null.

    The value of homedir returned by os.userInfo() is provided by the operating system. This differs from the result of os.homedir(), which queries environment variables for the home directory before falling back to the operating system response.

    Throws a SystemError if a user has no username or homedir.

    Parameters

    • options: { encoding: "buffer" }
      • encoding: "buffer"

    Returns "os".UserInfo<"buffer".Buffer>

  • Parameters

    • Optional options: { encoding: BufferEncoding }
      • encoding: BufferEncoding

    Returns "os".UserInfo<string>

  • Returns information about the currently effective user. On POSIX platforms, this is typically a subset of the password file. The returned object includes the username, uid, gid, shell, and homedir. On Windows, the uid andgid fields are -1, and shell is null.

    The value of homedir returned by os.userInfo() is provided by the operating system. This differs from the result of os.homedir(), which queries environment variables for the home directory before falling back to the operating system response.

    Throws a SystemError if a user has no username or homedir.

    Parameters

    • options: { encoding: "buffer" }
      • encoding: "buffer"

    Returns "os".UserInfo<"buffer".Buffer>

  • Parameters

    • Optional options: { encoding: BufferEncoding }
      • encoding: BufferEncoding

    Returns "os".UserInfo<string>

Generated using TypeDoc