process.geteuid()


process.geteuid()方法返回Node.js进程的有效数字标记的用户身份(See geteuid(2))。

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

注意:这个函数只在POSIX平台有效(在Windows或Android平台无效)。

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).