process.getegid()
process.getegid() 方法返回 Node.js 进程的数字有效群组标识。
(见 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 或安卓)。
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()}`);
}This function is only available on POSIX platforms (i.e. not Windows or Android).