On this page

    M

    process.getuid

    History
    process.getuid(): integer
    Returns:integer

    The 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.