process.getuid()


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

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

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

The process.getuid() method returns the numeric user identity of the process. (See getuid(2).)

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

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