time-to-botec/js/node_modules/@stdlib/process/getuid/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

1.6 KiB

getuid

Return the numeric user identity of the calling process.

Usage

var getuid = require( '@stdlib/process/getuid' );

getuid()

Returns the numeric user identity of the calling process.

var id = getuid();

Notes

  • The function only returns an integer user identity on POSIX platforms. For all other platforms (e.g., Windows, browsers, and Android), the function returns null.
  • See getuid(2).

Examples

var getuid = require( '@stdlib/process/getuid' );

var uid = getuid();
if ( uid === 0 ) {
    console.log( 'Likely running as root.' );
} else {
    console.log( 'uid: %d', uid );
}