Socket
Socket
Sign inDemoInstall

@amilajack/systeminformation

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amilajack/systeminformation

Advanced, lightweight system and OS information library


Version published
Maintainers
1
Weekly downloads
611
increased by654.32%

Weekly downloads

Readme

Source

systeminformation logo

systeminformation

System and OS information library for node.js
Explore Systeminformation docs »

Report bug · Request feature · Changelog

NPM Version NPM Downloads Git Issues Closed Issues no dependencies Code Quality: Javascript Total alerts Caretaker Sponsoring MIT license

This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 4 mio downloads per month, > 75 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!

New Version 5.0

The new Version 5 is here - I spend several weeks finalizing this new version. Any support is highly appreciated - Buy me a coffee

This next major version release 5.0 comes with new functionality and several improvements and changes (some of them are breaking changes!):

  • added audio: get detailed audio device information
  • added bluetooth: get detailed bluetooth device information
  • added dockerImages, dockerVolumes: get detailed information about docker images and volumes
  • added printer: get information from detected printers
  • added usb: get detailed usb controller and device information
  • added wifi interfaces ans connections: extended wifi information
  • better uuid function to get unique hardware and OS UUIDs
  • better/extended cpu info detection
  • better/extended system info detection
  • Apple Silicon M1 support
  • better Raspberry-PI detection
  • systeminformation website updated and extendet with full documentation and examples systeminformation.io
  • lot of minor improvements

Breaking Changes in version 5: you will see several breaking changes for the sake of a more consistent API interface and to be future proof. Read the detailed version 5 changes.

I did a lot of testing on different platforms and machines but of course there might be some issues that I am not aware of. I would be happy if you inform me when you discover any issues. Issues can be opened here.

Quick Start

Lightweight collection of 50+ functions to retrieve detailed hardware, system and OS information.

  • simple to use
  • get detailed information about system, cpu, baseboard, battery, memory, disks/filesystem, network, docker, software, services and processes
  • supports Linux, macOS, partial Windows, FreeBSD, OpenBSD, NetBSD, SunOS and Android support
  • no npm dependencies

Attention: this is a node.js library. It is supposed to be used as a backend/server-side library and will definitely not work within a browser.

Installation

$ npm install systeminformation --save
Still need Version 4?

If you need version 4 (for compatibility reasons), you can install version 4 (latest release) like this

$ npm install systeminformation@4 —save

Usage

All functions (except version and time) are implemented as asynchronous functions. Here a small example how to use them:

const si = require('systeminformation');

// promises style - new since version 3
si.cpu()
  .then(data => console.log(data))
  .catch(error => console.error(error));

News and Changes

Latest Activity

(last 7 major and minor version releases)

  • Version 5.11.0: networkInterfaces() added default property and default parameter
  • Version 5.10.0: basic android support
  • Version 5.9.0: graphics() added properties (macOS)
  • Version 5.8.0: disksIO() added waitTime, waitPercent (linux)
  • Version 5.7.0: diskLayout() added S.M.A.R.T for Windows (if installed)
  • Version 5.6.0: cpuTemperature() added added socket and chipset temp (linux)
  • Version 5.5.0: dockerVolumes() added
  • Version 5.4.0: dockerImages() added
  • Version 5.3.0: osInfo() added remoteSession (win only)
  • Version 5.2.0: wifiInterfaces() and wifiConnections() added
  • Version 5.1.0: memLayout() added ECC flag, bios() added language, features (linux)
  • Version 5.0.0: new version 5 - attention there are some breaking changes. See detailed version 5 changes here.
  • ...

You can find all changes here: detailed changelog

Core concept

Node.js comes with some basic OS information, but I always wanted a little more. So I came up to write this little library. This library is still work in progress. It is supposed to be used as a backend/server-side library (will definitely not work within a browser). It requires node.js version 4.0 and above.

I was able to test it on several Debian, Raspbian, Ubuntu distributions as well as macOS (Mavericks, Yosemite, El Captain, Sierra, High Sierra, Mojave, Catalina, Big Sur) and some Windows 7, Windows 8, Windows 10, FreeBSD, OpenBSD, NetBSD and SunOS machines. Not all functions are supported on all operating systems. Have a look at the function reference in the docs to get further details.

If you have comments, suggestions & reports, please feel free to contact me!

I also created a nice little command line tool called mmon (micro-monitor) for Linux and macOS, also available via github and npm

Reference

Function Reference and OS Support

Full function reference with examples can be found at https://systeminformation.io.

1. General
FunctionResult objectLinuxBSDMacWinSunComments
si.version(): stringXXXXXlib version (no callback/promise)
si.time(){...}XXXXX(no callback/promise)
currentXXXXXlocal (server) time
uptimeXXXXXuptime in number of seconds
timezoneXXXXXe.g. GMT+0200
timezoneNameXXXXXe.g. CEST
2. System (HW)
FunctionResult objectLinuxBSDMacWinSunComments
si.system(cb){...}XXXXhardware information
manufacturerXXXXe.g. 'MSI'
modelXXXXmodel/product e.g. 'MS-7823'
versionXXXXversion e.g. '1.0'
serialXXXXserial number
uuidXXXXUUID
skuXXXXSKU number
virtualXXXis virtual machine
virtualHostXXXvirtual host (if virtual)
raspberryXoptional raspberry revision data
si.bios(cb){...}XXXXbios information
vendorXXXXe.g. 'AMI'
versionXXXXversion
releaseDateXXXrelease date
revisionXXXrevision
serialXXserial
si.baseboard(cb){...}XXXXbaseboard information
manufacturerXXXXe.g. 'ASUS'
modelXXXXmodel / product name
versionXXXXversion
serialXXXXserial number
assetTagXXXXasset tag
memMaxXXXmax memory in bytes
memSlotsXXXmemory slots on baseboard
si.chassis(cb){...}XXXXchassis information
manufacturerXXXXe.g. 'MSI'
modelXXXXmodel / product name
typeXXXXmodel / product name
versionXXXXversion
serialXXXXserial number
assetTagXXXXasset tag
skuXSKU number
3. CPU
FunctionResult objectLinuxBSDMacWinSunComments
si.cpu(cb){...}XXXXCPU information
manufacturerXXXXe.g. 'Intel(R)'
brandXXXXe.g. 'Core(TM)2 Duo'
speedXXXXin GHz e.g. '3.40'
speedMinXXXin GHz e.g. '0.80'
speedMaxXXXXin GHz e.g. '3.90'
governorXe.g. 'powersave'
coresXXXX# cores
physicalCoresXXXX# physical cores
efficiencyCoresX# efficiancy cores (ARM only)
performanceCoresX# performance cores (ARM only)
processorsXXXX# processors
socketXXXsocket type e.g. "LGA1356"
vendorXXXXvendor ID
familyXXXXprocessor family
modelXXXXprocessor model
steppingXXXXprocessor stepping
revisionXXXrevision
voltageXvoltage
flagsXXXXCPU flags
virtualizationXXXXvirtualization supported
cacheXXXXcache in bytes (object)
cache.l1dXXXXL1D (data) size
cache.l1iXXXXL1I (instruction) size
cache.l2XXXXL2 size
cache.l3XXXXL3 size
si.cpuFlags(cb): stringXXXXCPU flags
si.cpuCache(cb){...}XXXXCPU cache sizes
l1dXXXXL1D size
l1iXXXXL1I size
l2XXXXL2 size
l3XXXXL3 size
si.cpuCurrentSpeed(cb){...}XXXXXcurrent CPU speed (in GHz)
avgXXXXXavg CPU speed (all cores)
minXXXXXmin CPU speed (all cores)
maxXXXXXmax CPU speed (all cores)
coresXXXXXCPU speed per core (array)
si.cpuTemperature(cb){...}XXX*XCPU temperature in C (if supported)
mainXXXXmain temperature (avg)
coresXXXXarray of temperatures
maxXXXXmax temperature
socketXarray socket temperatures
chipsetXchipset temperature
4. Memory
FunctionResult objectLinuxBSDMacWinSunComments
si.mem(cb){...}XXXXXMemory information (in bytes)
totalXXXXXtotal memory in bytes
freeXXXXXnot used in bytes
usedXXXXXused (incl. buffers/cache)
activeXXXXXused actively (excl. buffers/cache)
buffcacheXXXXused by buffers+cache
buffersXused by buffers
cachedXused by cache
slabXused by slab
availableXXXXXpotentially available (total - active)
swaptotalXXXXX
swapusedXXXXX
swapfreeXXXXX
si.memLayout(cb)[{...}]XXXXMemory Layout (array)
[0].sizeXXXXsize in bytes
[0].bankXXXmemory bank
[0].typeXXXXmemory type
[0].clockSpeedXXXXclock speed
[0].formFactorXXXform factor
[0].manufacturerXXXXmanufacturer
[0].partNumXXXXpart number
[0].serialNumXXXXserial number
[0].voltageConfiguredXXXvoltage conf.
[0].voltageMinXXXvoltage min
[0].voltageMaxXXXvoltage max
5. Battery
FunctionResult objectLinuxBSDMacWinSunComments
si.battery(cb){...}XXXXbattery information
hasBatteryXXXXindicates presence of battery
cycleCountXXnumbers of recharges
isChargingXXXXindicates if battery is charging
designedCapacityXXXmax capacity of battery (mWh)
maxCapacityXXXmax capacity of battery (mWh)
currentCapacityXXXcurrent capacity of battery (mWh)
capacityUnitXXXcapacity unit (mWh)
voltageXXXcurrent voltage of battery (V)
percentXXXXcharging level in percent
timeRemainingXXminutes left (if discharging)
acConnectedXXXXAC connected
typeXXbattery type
modelXXmodel
manufacturerXXmanufacturer
serialXXbattery serial
  • See known issues if you have problem with macOS temperature or windows temperature
6. Graphics
FunctionResult objectLinuxBSDMacWinSunComments
si.graphics(cb){...}XXXarrays of graphics controllers and displays
controllers[]XXXgraphics controllers array
...[0].vendorXXXe.g. ATI
...[0].vendorIdXvendor ID
...[0].modelXXXgraphics controller model
...[0].deviceIdXdevice ID
...[0].busXXXon which bus (e.g. PCIe)
...[0].vramXXXVRAM size (in MB)
...[0].vramDynamicXXXtrue if dynamicly allocated ram
...[0].externalXis external GPU
...[0].coresXApple silicon only
...[0].metalVersionXApple Metal Version
displays[]XXXmonitor/display array
...[0].vendorXmonitor/display vendor
...[0].vendorIdXvendor ID
...[0].deviceNameXe.g. \\.\DISPLAY1
...[0].modelXXXmonitor/display model
...[0].productionYearXproduction year
...[0].serialXserial number
...[0].displayIdXdisplay ID
...[0].mainXXXtrue if main monitor
...[0].builtinXXtrue if built in monitor
...[0].connectionXXXe.g. DisplayPort or HDMI
...[0].sizeXXXsize in mm horizontal
...[0].sizeYXXsize in mm vertical
...[0].pixelDepthXXXcolor depth in bits
...[0].resolutionXXXXpixel horizontal
...[0].resolutionYXXXpixel vertical
...[0].currentResXXXXcurrent pixel horizontal
...[0].currentResYXXXcurrent pixel vertical
...[0].positionXXdisplay position X
...[0].positionYXdisplay position Y
...[0].currentRefreshRateXXXcurrent screen refresh rate
7. Operating System
FunctionResult objectLinuxBSDMacWinSunComments
si.osInfo(cb){...}XXXXXOS information
platformXXXXX'linux', 'darwin', 'win32', ...
distroXXXXX
releaseXXXXX
codenameX
kernelXXXXXkernel release - same as os.release()
archXXXXXsame as os.arch()
hostnameXXXXXsame as os.hostname()
fqdnXXXXXFQDN fully qualified domain name
codepageXXXXOS build version
logofileXXXXXe.g. 'apple', 'debian', 'fedora', ...
serialXXXXOS/Host serial number
buildXXXOS build version
servicepackXservice pack version
uefiXXXXOS started via UEFI
hypervisorXhyper-v enabled? (win only)
remoteSessionXruns in remote session (win only)
si.uuid(cb){...}XXXXXobject of several UUIDs
osXXXXos specific UUID
hardwareXXXXhardware specific UUID
macsXXXXMAC addresses
si.versions(apps, cb){...}XXXXXversion information (kernel, ssl, node, ...)
apps param is optional for detecting
only specific apps/libs
(string, comma separated)
si.shell(cb): stringXXXXstandard shell
si.users(cb)[{...}]XXXXXarray of users online
[0].userXXXXXuser name
[0].ttyXXXXXterminal
[0].dateXXXXXlogin date
[0].timeXXXXXlogin time
[0].ipXXXXip address (remote login)
[0].commandXXXXlast command or shell
8. Current Load, Processes & Services
FunctionResult objectLinuxBSDMacWinSunComments
si.currentLoad(cb){...}XXXXCPU-Load
avgLoadXXXaverage load
currentLoadXXXXCPU load in %
currentLoadUserXXXXCPU load user in %
currentLoadSystemXXXXCPU load system in %
currentLoadNiceXXXXCPU load nice in %
currentLoadIdleXXXXCPU load idle in %
currentLoadIrqXXXXCPU load system in %
rawCurrentLoad...XXXXCPU load raw values (ticks)
cpus[]XXXXcurrent loads per CPU in % + raw ticks
si.fullLoad(cb): integerXXXCPU full load since bootup in %
si.processes(cb){...}XXXXX# running processes
allXXXXX# of all processes
runningXXXX# of all processes running
blockedXXXX# of all processes blocked
sleepingXXXX# of all processes sleeping
unknownX# of all processes unknown status
list[]XXXXXlist of all processes incl. details
...[0].pidXXXXXprocess PID
...[0].parentPidXXXXXparent process PID
...[0].nameXXXXXprocess name
...[0].cpuXXXXXprocess % CPU usage
...[0].cpuuXXXprocess % CPU usage (user)
...[0].cpusXXXprocess % CPU usage (system)
...[0].memXXXXXprocess memory %
...[0].priorityXXXXXprocess priotity
...[0].memVszXXXXXprocess virtual memory size
...[0].memRssXXXXXprocess mem resident set size
...[0].niceXXXXprocess nice value
...[0].startedXXXXXprocess start time
...[0].stateXXXXXprocess state (e.g. sleeping)
...[0].ttyXXXXtty from which process was started
...[0].userXXXXuser who started process
...[0].commandXXXXXprocess starting command
...[0].paramsXXXXprocess params
...[0].pathXXXXXprocess path
procXXXXprocess name
pidXXXXPID
pidsXXXXadditional pids
cpuXXXXprocess % CPU
memXXXXprocess % MEM
si.services('mysql, apache2', cb)[{...}]XXXXpass comma separated string of services
pass "*" for ALL services (linux/win only)
[0].nameXXXXname of service
[0].runningXXXXtrue / false
[0].startmodeXmanual, automatic, ...
[0].pidsXXXXpids
[0].cpuXXXprocess % CPU
[0].memXXXprocess % MEM
si.processLoad('mysql, apache2', cb)[{...}]XXXXpass comma separated string of processes
pass "*" for ALL processes (linux/win only)
[0].procXXXXname of process
[0].pidsXXXXpids
[0].cpuXXXprocess % CPU
[0].memXXXprocess % MEM
9. File System
FunctionResult objectLinuxBSDMacWinSunComments
si.diskLayout(cb)[{...}]XXXphysical disk layout (array)
[0].deviceXXe.g. /dev/sda
[0].typeXXXHD, SSD, NVMe
[0].nameXXXdisk name
[0].vendorXXvendor/producer
[0].sizeXXXsize in bytes
[0].bytesPerSectorXbytes per sector
[0].totalCylindersXtotal cylinders
[0].totalHeadsXtotal heads
[0].totalSectorsXtotal sectors
[0].totalTracksXtotal tracks
[0].tracksPerCylinderXtracks per cylinder
[0].sectorsPerTrackXsectors per track
[0].firmwareRevisionXXXfirmware revision
[0].serialNumXXXserial number
[0].interfaceTypeXXSATA, PCIe, ...
[0].smartStatusXXXS.M.A.R.T Status (see Known Issues)
[0].temperatureXS.M.A.R.T temperature
[0].smartDataXXfull S.M.A.R.T data from smartctl
requires at least smartmontools 7.0
si.blockDevices(cb)[{...}]XXXreturns array of disks, partitions,
raids and roms
[0].nameXXXname
[0].typeXXXtype
[0].fstypeXXXfile system type (e.g. ext4)
[0].mountXXXmount point
[0].sizeXXXsize in bytes
[0].physicalXXXphysical type (HDD, SSD, CD/DVD)
[0].uuidXXXUUID
[0].labelXXXlabel
[0].modelXXmodel
[0].serialXXserial
[0].removableXXXserial
[0].protocolXXprotocol (SATA, PCI-Express, ...)
si.disksIO(cb){...}XXcurrent transfer stats
rIOXXread IOs on all mounted drives
wIOXXwrite IOs on all mounted drives
tIOXXwrite IOs on all mounted drives
rIO_secXXread IO per sec (* see notes)
wIO_secXXwrite IO per sec (* see notes)
tIO_secXXtotal IO per sec (* see notes)
rWaitTimeXread IO request time (* see notes)
wWaitTimeXwrite IO request time (* see notes)
tWaitTimeXtotal IO request time (* see notes)
rWaitPercentXread IO request time percent (* see notes)
wWaitPercentXwrite IO request time percent (* see notes)
tWaitPercentXtotal IO request time percent (* see notes)
msXXinterval length (for per second values)
si.fsSize(cb)[{...}]XXXXreturns array of mounted file systems
[0].fsXXXXname of file system
[0].typeXXXXtype of file system
[0].sizeXXXXsizes in bytes
[0].usedXXXXused in bytes
[0].availableXXXXused in bytes
[0].useXXXXused in %
[0].mountXXXXmount point
si.fsOpenFiles(cb){...}XXXcount max/allocated file descriptors
maxXXXmax file descriptors
allocatedXXXcurrent open files count
availableXXXcount available
si.fsStats(cb){...}XXcurrent transfer stats
rxXXbytes read since startup
wxXXbytes written since startup
txXXtotal bytes read + written since startup
rx_secXXbytes read / second (* see notes)
wx_secXXbytes written / second (* see notes)
tx_secXXtotal bytes reads + written / second
msXXinterval length (for per second values)
10. USB
FunctionResult objectLinuxBSDMacWinSunComments
si.usb(cb)[{...}]XXXXget detected USB devices
[0].busXUSB bus
[0].deviceIdXbus device id
[0].idXXXinternal id
[0].nameXXXname
[0].typeXXXname
[0].removableXis removable
[0].vendorXXvendor
[0].manufacturerXXXmanifacturer
[0].maxPowerXmax power
[0].defaultXXXis default printer
[0].serialNumberXserial number
11. Printer
FunctionResult objectLinuxBSDMacWinSunComments
si.printer(cb)[{...}]XXXXget printer information
[0].idXXXinternal id
[0].nameXXXname
[0].modelXXXmodel
[0].uriXXprinter URI
[0].uuidXprinter UUID
[0].statusXXXprinter status (e.g. idle)
[0].localXXXis local printer
[0].defaultXXis default printer
[0].sharedXXXis shared printer
12. Audio
FunctionResult objectLinuxBSDMacWinSunComments
si.audio(cb)[{...}]XXXXget printer information
[0].idXXXinternal id
[0].nameXXXname
[0].manufacturerXXXmanufacturer
[0].revisionXrevision
[0].driverXdriver
[0].defaultXXis default
[0].channelXXchannel e.g. USB, HDMI, ...
[0].typeXXXtype e.g. Speaker
[0].inXXis input channel
[0].outXXis output channel
[0].interfaceTypeXXXinterface type (PCIe, USB, HDMI, ...)
[0].statusXXXprinter status (e.g. idle)
FunctionResult objectLinuxBSDMacWinSunComments
si.networkInterfaces(cb)[{...}]XXXXXarray of network interfaces
With the 'default' parameter it returns
only the default interface
[0].ifaceXXXXXinterface
[0].ifaceNameXXXXXinterface name (differs on Windows)
[0].defaultXXXXXtrue if this is the default interface
[0].ip4XXXXXip4 address
[0].ip4subnetXXXXXip4 subnet mask
[0].ip6XXXXXip6 address
[0].ip6subnetXXXXXip6 subnet mask
[0].macXXXXXMAC address
[0].internalXXXXXtrue if internal interface
[0].virtualXXXXXtrue if virtual interface
[0].operstateXXXup / down
[0].typeXXXwireless / wired
[0].duplexXXduplex
[0].mtuXXmaximum transmission unit
[0].speedXXXspeed in MBit / s
[0].dhcpXXXIP address obtained by DHCP
[0].dnsSuffixXXDNS suffix
[0].ieee8021xAuthXXIEEE 802.1x auth
[0].ieee8021xStateXXIEEE 802.1x state
[0].carrierChangesX# changes up/down
si.networkInterfaceDefault(cb): stringXXXXXget name of default network interface
si.networkGatewayDefault(cb): stringXXXXXget default network gateway
si.networkStats(ifaces,cb)[{...}]XXXXcurrent network stats of given interfaces
iface list: space or comma separated
iface parameter is optional
defaults to first external network interface,
Pass '*' for all interfaces
[0].ifaceXXXXinterface
[0].operstateXXXXup / down
[0].rx_bytesXXXXreceived bytes overall
[0].rx_droppedXXXXreceived dropped overall
[0].rx_errorsXXXXreceived errors overall
[0].tx_bytesXXXXtransferred bytes overall
[0].tx_droppedXXXXtransferred dropped overall
[0].tx_errorsXXXXtransferred errors overall
[0].rx_secXXXXreceived bytes / second (* see notes)
[0].tx_secXXXXtransferred bytes per second (* see notes)
[0].msXXXXinterval length (for per second values)
si.networkConnections(cb)[{...}]XXXXcurrent network network connections
returns an array of all connections
[0].protocolXXXXtcp or udp
[0].localAddressXXXXlocal address
[0].localPortXXXXlocal port
[0].peerAddressXXXXpeer address
[0].peerPortXXXXpeer port
[0].stateXXXXlike ESTABLISHED, TIME_WAIT, ...
[0].pidXXXXprocess ID
[0].processXXprocess name
si.inetChecksite(url, cb){...}XXXXXresponse-time (ms) to fetch given URL
urlXXXXXgiven url
okXXXXXstatus code OK (2xx, 3xx)
statusXXXXXstatus code
msXXXXXresponse time in ms
si.inetLatency(host, cb): numberXXXXXresponse-time (ms) to external resource
host parameter is optional (default 8.8.8.8)
14. Wifi
FunctionResult objectLinuxBSDMacWinSunComments
si.wifiNetworks(cb)[{...}]XXXarray of available wifi networks
[0].ssidXXXWifi network SSID
[0].bssidXXXBSSID (mac)
[0].modeXmode
[0].channelXXXchannel
[0].frequencyXXXfrequengy in MHz
[0].signalLevelXXXsignal level in dB
[0].qualityXXXquaility in %
[0].securityXXXarray e.g. WPA, WPA-2
[0].wpaFlagsXXXarray of WPA flags
[0].rsnFlagsXarray of RDN flags
si.wifiInterfaces(cb)[{...}]XXXarray of detected wifi interfaces
[0].idXXXID
[0].ifaceXXXinterface
[0].modelXXXmodel
[0].vendorXXXvendor
[0].macXXXMAC address
si.wifiConnections(cb)[{...}]XXXarray of active wifi connections
[0].idXXXID
[0].ifaceXXXinterface
[0].nameXXXname
[0].modeXXXmodel
[0].bssidXXXBSSID (mac)
[0].modeXmode
[0].channelXXXchannel
[0].frequencyXXXfrequengy in MHz
[0].signalLevelXXXsignal level in dB
[0].qualityXXXquaility in %
[0].securityXXXarray e.g. WPA, WPA-2
[0].txRateXXXtransfer rate MBit/s
15. Bluetooth
FunctionResult objectLinuxBSDMacWinSunComments
si.bluetoothDevices(cb)[{...}]XXX...
[0].deviceXdevice name
[0].nameXXXname
[0].macDeviceXXMAC address device
[0].macHostXXMAC address host
[0].batteryPercentXbattery level percent
[0].manufacturerXXmanufacturer
[0].typeXXXtypoe of bluetooth device
[0].connectedXXis connected
16. Docker
FunctionResult objectLinuxBSDMacWinSunComments
si.dockerInfo(cb){...}XXXXXreturns general docker info
idXXXXXDocker ID
containersXXXXXnumber of containers
containersRunningXXXXXnumber of running containers
containersPausedXXXXXnumber of paused containers
containersStoppedXXXXXnumber of stopped containers
imagesXXXXXnumber of images
driverXXXXXdriver (e.g. 'devicemapper', 'overlay2')
memoryLimitXXXXXhas memory limit
swapLimitXXXXXhas swap limit
kernelMemoryXXXXXhas kernal memory
cpuCfsPeriodXXXXXhas CpuCfsPeriod
cpuCfsQuotaXXXXXhas CpuCfsQuota
cpuSharesXXXXXhas CPUShares
cpuSetXXXXXhas CPUShares
ipv4ForwardingXXXXXhas IPv4Forwarding
bridgeNfIptablesXXXXXhas BridgeNfIptables
bridgeNfIp6tablesXXXXXhas BridgeNfIp6tables
debugXXXXXDebug on
nfdXXXXXnamed data networking forwarding daemon
oomKillDisableXXXXXout-of-memory kill disabled
ngoroutinesXXXXXnumber NGoroutines
systemTimeXXXXXdocker SystemTime
loggingDriverXXXXXlogging driver e.g. 'json-file'
cgroupDriverXXXXXcgroup driver e.g. 'cgroupfs'
nEventsListenerXXXXXnumber NEventsListeners
kernelVersionXXXXXdocker kernel version
operatingSystemXXXXXdocker OS e.g. 'Docker for Mac'
osTypeXXXXXOSType e.g. 'linux'
architectureXXXXXarchitecture e.g. x86_64
ncpuXXXXXnumber of CPUs
memTotalXXXXXmemory total
dockerRootDirXXXXXdocker root directory
httpProxyXXXXXhttp proxy
httpsProxyXXXXXhttps proxy
noProxyXXXXXNoProxy
nameXXXXXName
labelsXXXXXarray of labels
experimentalBuildXXXXXis experimental build
serverVersionXXXXXserver version
clusterStoreXXXXXcluster store
clusterAdvertiseXXXXXcluster advertise
defaultRuntimeXXXXXdefault runtime e.g. 'runc'
liveRestoreEnabledXXXXXlive store enabled
isolationXXXXXisolation
initBinaryXXXXXinit binary
productLicenseXXXXXproduct license
si.dockerImages(all, cb)[{...}]XXXXXreturns array of top level/all docker images
[0].idXXXXXimage ID
[0].containerXXXXXcontainer ID
[0].commentXXXXXcomment
[0].osXXXXXOS
[0].architectureXXXXXarchitecture
[0].parentXXXXXparent ID
[0].dockerVersionXXXXXdocker version
[0].sizeXXXXXimage size
[0].sharedSizeXXXXXshared size
[0].virtualSizeXXXXXvirtual size
[0].authorXXXXXauthor
[0].createdXXXXXcreated date / time
[0].containerConfigXXXXXcontainer config object
[0].graphDriverXXXXXgraph driver object
[0].repoDigestsXXXXXrepo digests array
[0].repoTagsXXXXXrepo tags array
[0].configXXXXXconfig object
[0].rootFSXXXXXroot fs object
si.dockerContainers(all, cb)[{...}]XXXXXreturns array of active/all docker containers
[0].idXXXXXID of container
[0].nameXXXXXname of container
[0].imageXXXXXname of image
[0].imageIDXXXXXID of image
[0].commandXXXXXcommand
[0].createdXXXXXcreation time (unix)
[0].startedXXXXXcreation time (unix)
[0].finishedXXXXXcreation time (unix)
[0].createdAtXXXXXcreation date time string
[0].startedAtXXXXXcreation date time string
[0].finishedAtXXXXXcreation date time string
[0].stateXXXXXcreated, running, exited
[0].portsXXXXXarray of ports
[0].mountsXXXXXarray of mounts
si.dockerContainerStats(ids, cb)[{...}]XXXXXstatistics for specific containers
container IDs: space or comma separated,
pass '*' for all containers
[0].idXXXXXContainer ID
[0].memUsageXXXXXmemory usage in bytes
[0].memLimitXXXXXmemory limit (max mem) in bytes
[0].memPercentXXXXXmemory usage in percent
[0].cpuPercentXXXXXcpu usage in percent
[0].pidsXXXXXnumber of processes
[0].netIO.rxXXXXXreceived bytes via network
[0].netIO.wxXXXXXsent bytes via network
[0].blockIO.rXXXXXbytes read from BlockIO
[0].blockIO.wXXXXXbytes written to BlockIO
[0].cpuStatsXXXXXdetailed cpu stats
[0].percpuStatsXXXXXdetailed per cpu stats
[0].memoryStatsXXXXXdetailed memory stats
[0].networksXXXXXdetailed network stats per interface
si.dockerContainerProcesses(id, cb)[{...}]XXXXXarray of processes inside a container
[0].pidHostXXXXXprocess ID (host)
[0].ppidXXXXXparent process ID
[0].pgidXXXXXprocess group ID
[0].userXXXXXeffective user name
[0].ruserXXXXXreal user name
[0].groupXXXXXeffective group name
[0].rgroupXXXXXreal group name
[0].statXXXXXprocess state
[0].timeXXXXXaccumulated CPU time
[0].elapsedXXXXXelapsed running time
[0].niceXXXXXnice value
[0].rssXXXXXresident set size
[0].vszXXXXXvirtual size in Kbytes
[0].commandXXXXXcommand and arguments
si.dockerVolumes(cb)[{...}]returns array of all docker volumes
[0].nameXXXXXvolume name
[0].driverXXXXXdriver
[0].labelsXXXXXlabels object
[0].mountpointXXXXXmountpoint
[0].optionsXXXXXoptions
[0].scopeXXXXXscope
[0].createdXXXXXcreated at
si.dockerAll(cb){...}XXXXXlist of all containers including their stats
and processes in one single array
17. Virtual Box
FunctionResult objectLinuxBSDMacWinSunComments
si.vboxInfo(cb)[{...}]XXXXXreturns array general virtual box info
[0].idXXXXXvirtual box ID
[0].nameXXXXXname
[0].runningXXXXXvbox is running
[0].startedXXXXXstarted date time
[0].runningSinceXXXXXrunning since (secs)
[0].stoppedXXXXXstopped date time
[0].stoppedSinceXXXXXstopped since (secs)
[0].guestOSXXXXXGuest OS
[0].hardwareUUIDXXXXXHardware UUID
[0].memoryXXXXXMemory in MB
[0].vramXXXXXVRAM in MB
[0].cpusXXXXXCPUs
[0].cpuExepCapXXXXXCPU exec cap
[0].cpuProfileXXXXXCPU profile
[0].chipsetXXXXXchipset
[0].firmwareXXXXXfirmware
[0].pageFusionXXXXXpage fusion
[0].configFileXXXXXconfig file
[0].snapshotFolderXXXXXsnapshot folder
[0].logFolderXXXXXlog folder path
[0].hpetXXXXXHPET
[0].paeXXXXXPAE
[0].longModeXXXXXlong mode
[0].tripleFaultResetXXXXXtriple fault reset
[0].apicXXXXXAPIC
[0].x2ApicXXXXXX2APIC
[0].acpiXXXXXACPI
[0].ioApicXXXXXIOAPIC
[0].biosApicModeXXXXXBIOS APIC mode
[0].bootMenuModeXXXXXboot menu Mode
[0].bootDevice1XXXXXbootDevice1
[0].bootDevice2XXXXXbootDevice2
[0].bootDevice3XXXXXbootDevice3
[0].bootDevice4XXXXXbootDevice4
[0].timeOffsetXXXXXtime Offset
[0].rtcXXXXXRTC
16. "Get All / Observe" - functions
FunctionResult objectLinuxBSDMacWinSunComments
si.getStaticData(cb){...}XXXXXall static data at once
si.getDynamicData(srv,iface,cb){...}XXXXXall dynamic data at once
Specify services and interfaces to monitor
Defaults to first external network interface
Pass "" for ALL services (linux/win only)
Pass "
" for ALL network interfaces
si.getAllData(srv,iface,cb){...}XXXXXall data at once
Specify services and interfaces to monitor
Defaults to first external network interface
Pass "" for ALL services (linux/win only)
Pass "
" for ALL network interfaces
si.get(valueObject,cb){...}XXXXXget partial system info data at once
In valueObject you can define
all values, you want to get back
(see documentation for details)
si.observe(valueObject,interval,cb)-XXXXXObserve a defined value object
call callback on changes
polling interval in milliseconds

cb: Asynchronous Function Calls (callback)

Remember: all functions (except version and time) are implemented as asynchronous functions! There are now three ways to consume them:

Callback Style

const si = require('systeminformation');

si.cpu(function(data) {
  console.log('CPU Information:');
  console.log('- manufucturer: ' + data.manufacturer);
  console.log('- brand: ' + data.brand);
  console.log('- speed: ' + data.speed);
  console.log('- cores: ' + data.cores);
  console.log('- physical cores: ' + data.physicalCores);
  console.log('...');
})

Promises

Promises Style is new in version 3.0.

When omitting callback parameter (cb), then you can use all function in a promise oriented way. All functions (except of version and time) are returning a promise, that you can consume:

const si = require('systeminformation');

si.cpu()
  .then(data => {
    console.log('CPU Information:');
    console.log('- manufucturer: ' + data.manufacturer);
    console.log('- brand: ' + data.brand);
    console.log('- speed: ' + data.speed);
    console.log('- cores: ' + data.cores);
    console.log('- physical cores: ' + data.physicalCores);
    console.log('...');
  })
  .catch(error => console.error(error));

Async / Await

Using async / await (available since node v7.6)

Since node v7.6 you can also use the async / await pattern. The above example would then look like this:

const si = require('systeminformation');

async function cpuData() {
  try {
    const data = await si.cpu();
    console.log('CPU Information:');
    console.log('- manufucturer: ' + data.manufacturer);
    console.log('- brand: ' + data.brand);
    console.log('- speed: ' + data.speed);
    console.log('- cores: ' + data.cores);
    console.log('- physical cores: ' + data.physicalCores);
    console.log('...');
  } catch (e) {
    console.log(e)
  }
}

Known Issues

macOS - Temperature Sensor

To be able to measure temperature on macOS I created a little additional package. Due to some difficulties in NPM with optionalDependencies I unfortunately was getting unexpected warnings on other platforms. So I decided to drop this optional dependency for macOS - so by default, you will not get correct values.

This additional package will unfortunately NOT work on Apple Silicon M1 machines.

But if you need to detect macOS temperature just run the following additional installation command:

$ npm install osx-temperature-sensor --save

systeminformation will then detect this additional library and return the temperature when calling systeminformations standard function cpuTemperature()

Windows Temperature, Battery, ...

get-WmiObject - which is used to determine temperature and battery sometimes needs to be run with admin privileges. So if you do not get any values, try to run it again with according privileges. If you still do not get any values, your system might not support this feature. In some cases we also discovered that get-WmiObject returned incorrect temperature values.

Linux Temperature

In some cases you need to install the Linux sensors package to be able to measure temperature e.g. on DEBIAN based systems by running sudo apt-get install lm-sensors

Linux S.M.A.R.T. Status

To be able to detect S.M.A.R.T. status on Linux you need to install smartmontools. On DEBIAN based Linux distributions you can install it by running sudo apt-get install smartmontools

Windows Encoding Issues

I now reimplemented all windows functions to avoid encoding problems (special chacarters). And as Windows 11 now droppend wmic support, I had to move completely to powershell. Be sure that powershell version 5+ is installed on your machine. On older Windows versions (7, 8) you might still see encoding problems due to the old powershell version.

*: Additional Notes

In fsStats(), disksIO() and networkStats() the results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning with the second call of the function. It is determined by calculating the difference of transferred bytes / IOs divided by the time between two calls of the function.

The first time you are calling one of these functions, you will get null for transfer rates. The second time, you should then get statistics based on the time between the two calls ...

So basically, if you e.g. need a value for network stats every second, your code should look like this:

const si = require('systeminformation');

setInterval(function() {
  si.networkStats().then(data => {
    console.log(data);
  })
}, 1000)

Beginning with the second call, you get network transfer values per second.

Finding new issues

I am happy to discuss any comments and suggestions. Please feel free to contact me if you see any possibility of improvement!

Comments

If you have ideas or comments, please do not hesitate to contact me.

Happy monitoring!

Sincerely,

Sebastian Hildebrandt, +innovations

Credits

Written by Sebastian Hildebrandt sebhildebrandt

Contributors

OSX Temperature: credits here are going to:

Linux is a registered trademark of Linus Torvalds. Apple, macOS, OS X are registered trademarks of Apple Inc., Windows is a registered trademark of Microsoft Corporation. Node.js is a trademark of Joyent Inc., Intel is a trademark of Intel Corporation, AMD is a trademark of Advanced Micro Devices Inc., Raspberry Pi is a trademark of the Raspberry Pi Foundation, Debian is a trademark of the Debian Project, Ubuntu is a trademark of Canonical Ltd., FreeBSD is a registered trademark of The FreeBSD Foundation, NetBSD is a registered trademark of The NetBSD Foundation, Docker is a trademark of Docker, Inc., Sun, Solaris, OpenSolaris and registered trademarks of Sun Microsystems, VMware is a trademark of VMware Inc, Virtual Box is a trademark of Oracle Corporation, Xen is a registered trademark of Xen Project, QEMU is a trademark of Fabrice Bellard, bochs is a trademark of The Bochs Project, USB and USB Logo are trademarks of USB Implementation Forum, Bluetooth and Bluetooth Logo are trademarks of Bluetooth SIG, Android is a trademark of Google LLC.

All other trademarks are the property of their respective owners.

License MIT license

The MIT License (MIT)

Copyright © 2014-2021 Sebastian Hildebrandt, +innovations.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Further details see LICENSE file.

Keywords

FAQs

Last updated on 16 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc