Skip to content

Commit f6ebd81

Browse files
PoojaDurgadBethGriggs
authored andcommittedDec 7, 2020
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 2c34266 commit f6ebd81

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
@@ -1340,6 +1340,12 @@ The `process.getgroups()` method returns an array with the supplementary group
13401340
IDs. POSIX leaves it unspecified if the effective group ID is included but
13411341
Node.js ensures it always is.
13421342

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

0 commit comments

Comments
 (0)
Please sign in to comment.