From f59d4e05a209173406465a26330465413264a443 Mon Sep 17 00:00:00 2001 From: "Pooja D.P" Date: Tue, 13 Oct 2020 11:30:04 +0400 Subject: [PATCH] doc: add example code for process.getgroups() PR-URL: https://github.com/nodejs/node/pull/35625 Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- doc/api/process.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/process.md b/doc/api/process.md index 8b3925a6bb6f3f..4b47573ee9f4ed 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -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).