On this page

    M

    process.geteuid

    History
    process.geteuid(): Object
    Returns:Object

    The process.geteuid() method returns the numerical effective user identity of the process. (See geteuid(2).)

    import process from 'node:process';
    
    if (process.geteuid) {
      console.log(`Current uid: ${process.geteuid()}`);
    }
    if (process.geteuid) {
      console.log(`Current uid: ${process.geteuid()}`);
    }

    This function is only available on POSIX platforms (i.e. not Windows or Android).