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: #35625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
PoojaDurgad authored and BethGriggs committed Dec 7, 2020
1 parent 2c34266 commit f6ebd81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,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 f6ebd81

Please sign in to comment.