process.getegid()
process.getegid() 方法返回 Node.js 进程的有效组标识的数字值。(参见 getegid(2)。)
【The process.getegid() method returns the numerical effective group identity
of the Node.js process. (See getegid(2).)】
import process from 'node:process';
if (process.getegid) {
console.log(`Current gid: ${process.getegid()}`);
}const process = require('node:process');
if (process.getegid) {
console.log(`Current gid: ${process.getegid()}`);
}此功能仅在 POSIX 平台上可用(即不包括 Windows 或 Android)。
【This function is only available on POSIX platforms (i.e. not Windows or Android).】