Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc: add example code for process.getgroups()
PR-URL: #35625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
PoojaDurgad authored and Trott committed Oct 15, 2020
1 parent 8a3808d commit f59d4e0
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 f59d4e0

Please sign in to comment.