systeminformation

System Information Library for Node.JS

  • Owner: sebhildebrandt/systeminformation
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 250 versions published, up to 1 mio downloads per month, > 5 mio downloads overall. Thank you to all who contributed to this project!

New Version 4.0

This next major version release 4.0 comes with several optimizations and changes:

  • new systeminformation website with better documentation and examples systeminformation.io
  • added typescript definitions
  • reworked network section: this will now return more information and allows to get networkStats for more than one interface at once.
  • dockerContainerStats for multiple containers or all containers at once
  • optimized graphics controller and display detection
  • added wifiNetworks to get available wifi networks
  • added vboxInfo to get detailed vm information
  • added chassis information
  • better Raspberry-PI detection
  • lot of minor improvements

Breaking Changes: you will see some minor breaking changes. Read the detailed changelog.

Quick Start

Lightweight collection of 40+ 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 and SunOS support
  • no npm dependencies (for production)

Installation

$ npm install systeminformation --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));

Callback, Promises, Awync Await

News and Changes

Latest Activity

(last 7 major and minor version releases)

  • Version 4.22.0: services() added pids (windows)
  • Version 4.21.0: added npx copmpatibility
  • Version 4.20.0: battery() added designcapacity, voltage, unit
  • Version 4.19.0: osInfo() added uefi (OS uses UEFI during startup)
  • Version 4.18.0: networkInterfaces() added dhcp for mac os, added dhcp linux fallback
  • Version 4.17.0: networkInterfaces() added dhcp, dnsSuffix, ieee8021xAuth, ieee8021xState
  • Version 4.16.0: networkGatewayDefault() added
  • ...

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 definilely 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) and some Windows 7, 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

1. General, Function, Result object, Linux, BSD, Mac, Win, Sun, Comments, ---------------, -------------, -----, -------, ---, ---, ---, --------, si.version(), : string, X, X, X, X, X, lib version (no callback/promise), si.time(), {...}, X, X, X, X, X, (no callback/promise), current, X, X, X, X, X, local (server) time, uptime, X, X, X, X, X, uptime, timezone, X, X, X, X, X, e.g. GMT+0200, timezoneName, X, X, X, X, X, e.g. CEST, #### 2. System (HW), Function, Result object, Linux, BSD, Mac, Win, Sun, Comments, ---------------, -------------, -----, -------, ---, ---, ---, --------, si.system(cb), {...}, X, X, X, X, hardware information, manufacturer, X, X, X, X, e.g. 'MSI', model, X, X, X, X, model/product e.g. 'MS-7823', version, X, X, X, X, version e.g. '1.0', serial, X, X, X, X, serial number, uuid, X, X, X, X, UUID, sku, X, X, X, X, SKU number, si.bios(cb), {...}, X, X, X, X, bios information, vendor, X, X, X, X, e.g. 'AMI', version, X, X, X, version, releaseDate, X, X, X, release date, revision, X, X, X, revision, si.baseboard(cb), {...}, X, X, X, X, baseboard information, manufacturer, X, X, X, X, e.g. 'ASUS', model, X, X, X, X, model / product name, version, X, X, X, X, version, serial, X, X, X, X, serial number, assetTag, X, X, X, X, asset tag, si.chassis(cb), {...}, X, X, X, X, chassis information, manufacturer, X, X, X, X, e.g. 'MSI', model, X, X, X, X, model / product name, type, X, X, X, X, model / product name, version, X, X, X, X, version, serial, X, X, X, X, serial number, assetTag, X, X, X, X, asset tag, sku, X, SKU number, #### 3. CPU, Function, Result object, Linux, BSD, Mac, Win, Sun, Comments, ---------------, -------------, -----, -------, ---, ---, ---, --------, si.cpu(cb), {...}, X, X, X, X, CPU information, manufacturer, X, X, X, X, e.g. 'Intel(R)', brand, X, X, X, X, e.g. 'Core(TM)2 Duo', speed, X, X, X, X, in GHz e.g. '3.40', speedmin, X, X, X, in GHz e.g. '0.80', speedmax, X, X, X, X, in GHz e.g. '3.90', governor, X, e.g. 'powersave', cores, X, X, X, X, # cores, physicalCores, X, X, X, X, # physical cores, processors, X, X, X, X, # processors, socket, X, X, X, socket type e.g. "LGA1356", vendor, X, X, X, X, vendor ID, family, X, X, X, X, processor family, model, X, X, X, X, processor model, stepping, X, X, X, X, processor stepping, revision, X, X, X, revision, voltage, X, voltage, cache, X, X, X, X, cache in bytes (object), cache.l1d, X, X, X, X, L1D (data) size, cache.l1i, X, X, X, X, L1I (instruction) size, cache.l2, X, X, X, X, L2 size, cache.l3, X, X, X, X, L3 size, si.cpuFlags(cb), : string, X, X, X, X, CPU flags, si.cpuCache(cb), {...}, X, X, X, X, CPU cache sizes, l1d, X, X, X, X, L1D size, l1i, X, X, X, X, L1I size, l2, X, X, X, X, L2 size, l3, X, X, X, X, L3 size, si.cpuCurrentspeed(cb), {...}, X, X, X, X, X, current CPU speed (in GHz), avg, X, X, X, X, X, avg CPU speed (all cores), min, X, X, X, X, X, min CPU speed (all cores), max, X, X, X, X, X, max CPU speed (all cores), cores, X, X, X, X, X, CPU speed per core (array), si.cpuTemperature(cb), {...}, X, X, X*, X, CPU temperature (if supported), main, X, X, X, X, main temperature (avg), cores, X, X, X, X, array of temperatures, max, X, X, X, X, max temperature, #### 4. Memory, Function, Result object, Linux, BSD, Mac, Win, Sun, Comments, ---------------, -------------, -----, -------, ---, ---, ---, --------, si.mem(cb), {...}, X, X, X, X, X, Memory information (in bytes), total, X, X, X, X, X, total memory in bytes, free, X, X, X, X, X, not used in bytes, used, X, X, X, X, X, used (incl. buffers/cache), active, X, X, X, X, X, used actively (excl. buffers/cache), buffcache, X, X, X, X, used by buffers+cache, buffers, X, used by buffers, cached, X, used by cache, slab, X, used by slab, available, X, X, X, X, X, potentially available (total - active), swaptotal, X, X, X, X, X, swapused, X, X, X, X, X, swapfree, X, X, X, X, X, si.memLayout(cb), [{...}], X, X, X, X, Memory Layout (array), [0].size, X, X, X, X, size in bytes, [0].bank, X, X, X, memory bank, [0].type, X, X, X, X, memory type, [0].clockSpeed, X, X, X, X, clock speed, [0].formFactor, X, X, X, form factor, [0].manufacturer, X, X, X, X, manufacturer, [0].partNum, X, X, X, X, part number, [0].serialNum, X, X, X, X, serial number, [0].voltageConfigured, X, X, X, voltage conf., [0].voltageMin, X, X, X, voltage min, [0].voltageMax, X, X, X, voltage max, #### 5. Battery, Function, Result object, Linux, BSD, Mac, Win, Sun, Comments, ---------------, -------------, -----, -------, ---, ---, ---, --------, si.battery(cb), {...}, X, X, X, X, battery information, hasbattery, X, X, X, X, indicates presence of battery, cyclecount, X, X, numbers of recharges, ischarging, X, X, X, X, indicates if battery is charging, designedcapacity, X, X, X, max capacity of battery (mWh), maxcapacity, X, X, X, max capacity of battery (mWh), currentcapacity, X, X, X, current capacity of battery (mWh), capacityUnit, X, X, X, capacity unit (mWh), voltage, X, X, X, current voltage of battery (V), percent, X, X, X, X, charging level in percent, timeremaining, X, X, minutes left (if discharging), acconnected, X, X, X, X, AC connected, type, X, X, battery type, model, X, X, model, manufacturer, X, X, manufacturer, serial, X, X, battery serial, * See known issues if you have problem with macOS temperature or windows temperature

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 (exept 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.

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, ...

wmic - 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 wmic 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

*: 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 this functions, you will get -1 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 values 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

Contributers

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.

All other trademarks are the property of their respective owners.

License MIT license

The MIT License (MIT)

Copyright © 2014-2020 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.

Main metrics

Overview
Name With Ownersebhildebrandt/systeminformation
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2014-03-12 18:16:59
Pushed At2025-06-19 13:01:46
Last Commit At2025-06-19 15:01:38
Release Count487
Last Release Namev5.27.5 (Posted on 2025-06-19 11:19:11)
First Release Namev3.42.5 (Posted on 2018-08-03 14:04:49)
用户参与
Stargazers Count2.9k
Watchers Count36
Fork Count329
Commits Count2k
Has Issues Enabled
Issues Count784
Issue Open Count120
Pull Requests Count22
Pull Requests Open Count9
Pull Requests Close Count175
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private