VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-process-getgroups-method/

⇱ Node.js process.getgroups() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js process.getgroups() Method

Last Updated : 28 Apr, 2025

The process.getgroups() method is an inbuilt application programming interface of the Process module which is used to get the supplementary group IDs. 

Syntax:

process.getgroups()

Parameters: This method does not accept any parameters. 

Return: It returns an integer array specifying supplementary group IDs. 

Note: This function will only work on POSIX platforms. Not available on windows or android platforms so will cause an error i.e. TypeError, getgroups is not a function. 

Below examples illustrate the use of process.getgroups() method in Node.js: 

Example 1: 

Output:

[0]

Example 2: 

Output:

The supplementary group IDs :[0]

Reference: https://nodejs.org/api/process.html#process_process_getgroups

Comment

Explore