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