Skip to content

Commit f59d4e0

Browse files
PoojaDurgadTrott
authored andcommitted
doc: add example code for process.getgroups()
PR-URL: #35625 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 8a3808d commit f59d4e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/process.md

+6
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,12 @@ The `process.getgroups()` method returns an array with the supplementary group
13421342
IDs. POSIX leaves it unspecified if the effective group ID is included but
13431343
Node.js ensures it always is.
13441344

1345+
```js
1346+
if (process.getgroups) {
1347+
console.log(process.getgroups()); // [ 16, 21, 297 ]
1348+
}
1349+
```
1350+
13451351
This function is only available on POSIX platforms (i.e. not Windows or
13461352
Android).
13471353

0 commit comments

Comments
 (0)