process.getuid(): integer
Returns:
integerThe process.getuid() method returns the numeric user identity of the process.
(See getuid(2).)
import process from 'node:process'; if (process.getuid) { console.log(`Current uid: ${process.getuid()}`); }
if (process.getuid) { console.log(`Current uid: ${process.getuid()}`); }
This function not available on Windows.