process.getgroups()
- 返回: <integer[]>
process.getgroups()
方法返回带有补充组 ID 的数组。
POSIX 不指定是否包含有效组 ID,但 Node.js 确保它始终包含。
if (process.getgroups) {
console.log(process.getgroups()); // [ 16, 21, 297 ]
}
此功能仅适用于 POSIX 平台(即不适用于 Windows 或安卓)。
- Returns: <integer[]>
The process.getgroups()
method returns an array with the supplementary group
IDs. POSIX leaves it unspecified if the effective group ID is included but
Node.js ensures it always is.
if (process.getgroups) {
console.log(process.getgroups()); // [ 16, 21, 297 ]
}
This function is only available on POSIX platforms (i.e. not Windows or Android).