2026-01-03 10:30:21 +01:00

665 lines
24 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.1/css/all.css" integrity="sha384-9ZfPnbegQSumzaE7mks2IYgHoayLtuto3AS6ieArECeaR8nCfliJVuLh/GaQ1gyM" crossorigin="anonymous">
<link rel="stylesheet" href="roboto/css/roboto.css">
<link rel="stylesheet" href="styles.css">
<script src="main.js"></script>
<!-- Favicon -->
<link rel="icon" type="image/png" sizes="192x192" href="/assets/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/assets/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js" integrity="sha512-XJ+kBRoBFQps17m1/oCbbESEJtXMrCKq6Ls2a9MKSwoQsSrUk8i+qOd/7YXfl3BsAlfjUyQ4EPd0b0JB24Bgwg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>hljs.initHighlightingOnLoad();</script>
<title>systeminformation</title>
</head>
<body>
<nav class="nav">
<div class="container">
<a href="."><img class="logo float-left" src="assets/logo.png" alt="logo">
<div class="title float-left">systeminformation</div>
</a>
<div class="text float-right github"><a href="https://github.com/sebhildebrandt/systeminformation">View on Github <i class="fab fa-github"></i></a></div>
<div class="text float-right todocs"><a href="./#docs">Docs Overview</a></div>
</div>
</nav>
<div class="container-fluid">
<section class="container">
<div class="row">
<div class="col-12 col-md-4 col-lg-3 col-xl-2 menu" id="menu">
</div>
<div class="col-12 col-md-8 col-lg-9 col-xl-10 content">
<div class="row">
<div class="col-12 sectionheader">
<div class="title">CPU</div>
<div class="text">
<p>In this section you will learn how to get CPU data including current speed and temperature:</p>
<p>For function reference and examples we assume, that we imported <span class="code">systeminformation</span> as follows:</p>
<pre><code class="js">const si = require('systeminformation');</code></pre>
<h2>CPU Data</h2>
<p>All functions in this section return a promise or can be called with a callback function (parameter <span class="code">cb</span> in the function reference)</p>
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th>Function</th>
<th>Result object</th>
<th>Linux</th>
<th>BSD</th>
<th>Mac</th>
<th>Win</th>
<th>Sun</th>
<th>Comments</th>
</tr>
</thead>
<tbody>
<tr>
<td>si.cpu(cb)</td>
<td>{...}</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>CPU information object</td>
</tr>
<tr>
<td></td>
<td>manufacturer</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>e.g. 'Intel(R)'</td>
</tr>
<tr>
<td></td>
<td>brand</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>e.g. 'Core(TM)2 Duo'</td>
</tr>
<tr>
<td></td>
<td>speed</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>in GHz e.g. 3.4</td>
</tr>
<tr>
<td></td>
<td>speedMin</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>in GHz e.g. 0.8</td>
</tr>
<tr>
<td></td>
<td>speedMax</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>in GHz e.g. 3.9</td>
</tr>
<tr>
<td></td>
<td>governor</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>e.g. 'powersave'</td>
</tr>
<tr>
<td></td>
<td>cores</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td># cores</td>
</tr>
<tr>
<td></td>
<td>physicalCores</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td># physical cores</td>
</tr>
<tr>
<td></td>
<td>performanceCores</td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td># performance cores</td>
</tr>
<tr>
<td></td>
<td>efficiencyCores</td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td># efficiency cores</td>
</tr>
<tr>
<td></td>
<td>processors</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td># processors</td>
</tr>
<tr>
<td></td>
<td>socket</td>
<td>X</td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>
<td>socket type e.g. &quot;LGA1356&quot;</td>
</tr>
<tr>
<td></td>
<td>vendor</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>vendor ID</td>
</tr>
<tr>
<td></td>
<td>family</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>processor family</td>
</tr>
<tr>
<td></td>
<td>model</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>processor model</td>
</tr>
<tr>
<td></td>
<td>stepping</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>processor stepping</td>
</tr>
<tr>
<td></td>
<td>revision</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>revision</td>
</tr>
<tr>
<td></td>
<td>voltage</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td>voltage</td>
</tr>
<tr>
<td></td>
<td>flags</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>CPU flags</td>
</tr>
<tr>
<td></td>
<td>virtualization</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>supports virtualization</td>
</tr>
<tr>
<td></td>
<td>cache</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>cache in bytes (object)</td>
</tr>
<tr>
<td></td>
<td>cache.l1d</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L1D (data) size in bytes</td>
</tr>
<tr>
<td></td>
<td>cache.l1i</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L1I (instruction) size in bytes</td>
</tr>
<tr>
<td></td>
<td>cache.l2</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L2 size in bytes</td>
</tr>
<tr>
<td></td>
<td>cache.l3</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L3 size in bytes</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.cpu().then(data => console.log(data));</code></pre>
<pre class="example">
{
manufacturer: 'Intel®',
brand: 'Core™ i9-9900',
vendor: 'GenuineIntel',
family: '6',
model: '158',
stepping: '13',
revision: '',
voltage: '',
speed: 3.1,
speedMin: 0.8,
speedMax: 5,
governor: 'powersave',
cores: 16,
physicalCores: 8,
processors: 1,
socket: 'LGA1151',
flags: 'fpu vme de pse ...',
virtualization: true,
cache: { l1d: 262144, l1i: 262144, l2: 2097152, l3: 16777216 }
}</pre>
</td>
</tr>
<tr>
<td>si.cpuFlags(cb)</td>
<td>: string</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>CPU flags</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.cpuFlags().then(data => console.log(data));</code></pre>
<pre class="example">
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
</pre>
</td>
</tr>
<tr>
<td>si.cpuCache(cb)</td>
<td>{...}</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>CPU cache sizes object</td>
</tr>
<tr>
<td></td>
<td>l1d</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L1D size in bytes</td>
</tr>
<tr>
<td></td>
<td>l1i</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L1I size in bytes</td>
</tr>
<tr>
<td></td>
<td>l2</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L2 size in bytes</td>
</tr>
<tr>
<td></td>
<td>l3</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>L3 size in bytes</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.cpuCache().then(data => console.log(data));</code></pre>
<pre class="example">
{ l1d: 262144, l1i: 262144, l2: 2097152, l3: 16777216 }
</pre>
</td>
</tr>
<tr>
<td>si.cpuCurrentSpeed(cb)</td>
<td>{...}</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>current CPU speed (GHz) object</td>
</tr>
<tr>
<td></td>
<td>avg</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>avg CPU speed (all cores)</td>
</tr>
<tr>
<td></td>
<td>min</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>min CPU speed (all cores)</td>
</tr>
<tr>
<td></td>
<td>max</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>max CPU speed (all cores)</td>
</tr>
<tr>
<td></td>
<td>cores</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>CPU speed per core (array)</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.cpuCurrentSpeed().then(data => console.log(data));</code></pre>
<pre class="example">
{
min: 0.86,
max: 1.77,
avg: 1.49,
cores: [
1.59, 1.71, 1.62, 1.57,
1.66, 1.77, 1.74, 1.75,
1.49, 1.51, 1.52, 1.59,
1.56, 1.03, 0.86, 0.86
]
}
</pre>
</td>
</tr>
<tr>
<td>si.cpuTemperature(cb)</td>
<td>{...}</td>
<td>X</td>
<td>X</td>
<td>X*</td>
<td>X</td>
<td></td>
<td>CPU temperature in Celsius<br>(if supported)</td>
</tr>
<tr>
<td></td>
<td>main</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>main temperature (avg)</td>
</tr>
<tr>
<td></td>
<td>cores</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>array of temperatures</td>
</tr>
<tr>
<td></td>
<td>max</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>max temperature</td>
</tr>
<tr>
<td></td>
<td>socket</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>array socket temperatures</td>
</tr>
<tr>
<td></td>
<td>chipset</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>chipset temperature</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.cpuTemperature().then(data => console.log(data));</code></pre>
<pre class="example">
{
main: 34,
cores: [
34, 35, 33, 32,
37, 32, 35, 33
],
max: 37,
socket: [ 16.8, 27.8 ],
chipset: 49
}
</pre>
</td>
</tr>
</tbody>
</table>
<h2>Known issues</h2>
<h4>macOS - Temperature</h4>
<p>To be able to measure temperature on macOS I created twu little additional packages. Due to some difficulties in NPM with <span class="code">optionalDependencies</span>
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.</p>
<p>But if you need to detect macOS temperature just run the following additional installation command. Wether you have Intel or Apple Silicon machines, install one of the following packages:</p>
<pre>$ npm install osx-temperature-sensor # deprecated - for intel based machines</pre>
<pre>$ npm install macos-temperature-sensor # for apple silicon machines</pre>
<p>systeminformation will then detect this additional library and return the temperature when calling systeminformations standard function <span class="code">cpuTemperature()</span></p>
<h4>Windows Temperature</h4>
<p><span class="code">get-WmiObject</span> - which is used to determine 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. </p>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<footer class="container-fluid footer">
<div class="container">
<div class="row">
<div class="col-lg-4 col-12">
<ul class="list-unstyled">
<li><a href="." class="medium home">Home</a></li>
<li>&nbsp;</li>
<li><a href="security.html">Security Advisories&nbsp;&nbsp;<i class="fas fa-shield-check"></i></a></li>
<li><a href="https://github.com/sebhildebrandt/systeminformation">Github <i class="fab fa-github"></i></a></li>
<li>&nbsp;</li>
<li><a href="https://buymeacoff.ee/systeminfo" class="medium badge bg-primary"><i class="fas fa-coffee"></i>&nbsp;&nbsp;Buy me a coffee</a></li>
</ul>
</div>
<div class="col-lg-4 col-12">
<ul class="list-unstyled">
<li><a href="gettingstarted.html">Quick Start</a></li>
<li><a href="changes.html">Version 5 Changes</a></li>
<li><a href="history.html">Full Version History</a></li>
<li><a href="tests.html">Testing</a></li>
<li><a href="issues.html">Known Issues</a></li>
<li><a href="statsfunctions.html">Stats Functions</a></li>
</ul>
</div>
<div class="col-lg-4 col-12">
<ul class="list-unstyled">
<li><a href="contributors.html">Contributors</a></li>
<li><a href="trademarks.html">Trademarks</a></li>
<li>&nbsp;</li>
<li><a href="copyright.html">Copyright &amp; License&nbsp;&nbsp;<img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
<li><a href="https://www.plus-innovations.com">&copy; 2026 Sebastian Hildebrandt</a></li>
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
</ul>
</div>
</div>
</div>
</footer>
<script>
window.onload = function (e) {
createMenu();
}
</script>
</body>
</html>