Skip to content

Commit

Permalink
doc: add example code for process.getgroups()
Browse files Browse the repository at this point in the history
PR-URL: nodejs#35625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
PoojaDurgad authored and joesepi committed Oct 22, 2020
1 parent e803244 commit 6f86a70
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/process.md
Expand Up @@ -1342,6 +1342,12 @@ 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.

```js
if (process.getgroups) {
console.log(process.getgroups()); // [ 16, 21, 297 ]
}
```

This function is only available on POSIX platforms (i.e. not Windows or
Android).

Expand Down

0 comments on commit 6f86a70

Please sign in to comment.