Return the effective numeric user identity of the calling process.
var geteuid = require( '@stdlib/process/geteuid' );Returns the effective numeric user identity of the calling process.
var id = geteuid();- The function only returns an
integeruser identity on POSIX platforms. For all other platforms (e.g., Windows, browsers, and Android), the function returnsnull. - See geteuid(2).
var geteuid = require( '@stdlib/process/geteuid' );
var uid = geteuid();
if ( uid === 0 ) {
console.log( 'Effectively running as root.' );
} else {
console.log( 'uid: %d', uid );
}@stdlib/process/getegid: return the effective numeric group identity of a calling process.@stdlib/process/getgid: return the numeric group identity of a calling process.@stdlib/process/getuid: return the numeric user identity of a calling process.