process.geteuid()


process.geteuid() 方法返回进程的数字有效用户身份。 (见 geteuid(2)。)

if (process.geteuid) {
  console.log(`Current uid: ${process.geteuid()}`);
}

此功能仅适用于 POSIX 平台(即不适用于 Windows 或安卓)。

The process.geteuid() method returns the numerical effective user identity of the process. (See geteuid(2).)

if (process.geteuid) {
  console.log(`Current uid: ${process.geteuid()}`);
}

This function is only available on POSIX platforms (i.e. not Windows or Android).