This module provides many functions that you can use to retrieve information from the underlying operating system and the computer the program runs on, and interact with it.
List of Functions
Returns the operating system CPU architecture for which the Node.js binary was compiled. Possible values are
Contains commonly used operating system-specific constants for error codes, process signals, and so on. The specific constants defined are described in OS constants.
Returns an array of objects containing information about each logical CPU core.
The properties included on each object include:
speed<number> (in MHz)
user<number> The number of milliseconds the CPU has spent in user mode.
nice<number> The number of milliseconds the CPU has spent in nice mode.
sys<number> The number of milliseconds the CPU has spent in sys mode.
idle<number> The number of milliseconds the CPU has spent in idle mode.
irq<number> The number of milliseconds the CPU has spent in irq mode.
Returns the amount of free system memory in bytes as an integer.
Returns the scheduling priority for the process specified by
pid is not provided or is
0, the priority of the current process is returned.
Returns the string path of the current user's home directory.
On POSIX, it uses the
$HOME environment variable if defined. Otherwise it uses the effective UID to look up the user's home directory.
On Windows, it uses the
USERPROFILE environment variable if defined. Otherwise it uses the path to the profile directory of the current user.
Returns the host name of the operating system as a string.
Returns an object containing network interfaces that have been assigned a network address.
Each key on the returned object identifies a network interface. The associated value is an array of objects that each describe an assigned network address.
The properties available on the assigned network address object include:
address<string> The assigned IPv4 or IPv6 address
netmask<string> The IPv4 or IPv6 network mask
mac<string> The MAC address of the network interface
trueif the network interface is a loopback or similar interface that is not remotely accessible; otherwise
scopeid<number> The numeric IPv6 scope ID (only specified when
cidr<string> The assigned IPv4 or IPv6 address with the routing prefix in CIDR notation. If the
netmaskis invalid, this property is set to
Subscribe and follow us for latest news in Data Science and Machine learning and stay updated!