networkConnections() fix pid issue (macOS)

This commit is contained in:
Sebastian Hildebrandt 2025-12-08 20:07:25 +01:00
parent c6e8ae960a
commit 647d778c5f
52 changed files with 1547 additions and 1511 deletions

View File

@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- | | ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.27.12 | 2025-12-09 | `networkConnections()` fix pid issue (macOS) |
| 5.27.11 | 2025-10-05 | `system()` added latest mac studio versions (macOS) | | 5.27.11 | 2025-10-05 | `system()` added latest mac studio versions (macOS) |
| 5.27.10 | 2025-09-16 | `powerShell()` adapted params (windows) | | 5.27.10 | 2025-09-16 | `powerShell()` adapted params (windows) |
| 5.27.9 | 2025-09-13 | `typings` fsOpenFiles typings fixed | | 5.27.9 | 2025-09-13 | `typings` fsOpenFiles typings fixed |

View File

@ -192,7 +192,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.audio().then(data => console.log(data));</code></pre class="example"> si.audio().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -222,6 +222,7 @@ si.audio().then(data => console.log(data));</code></pre class="example">
status: 'online' status: 'online'
} }
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -230,7 +231,6 @@ si.audio().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -242,7 +242,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.battery().then(data => console.log(data));</code></pre class="example"> si.battery().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
hasBattery: true, hasBattery: true,
@ -261,6 +261,7 @@ si.battery().then(data => console.log(data));</code></pre class="example">
manufacturer: 'Apple', manufacturer: 'Apple',
serial: 'F9Y19860Y9AH9XBAX' serial: 'F9Y19860Y9AH9XBAX'
}</pre> }</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -276,7 +277,6 @@ si.battery().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -162,7 +162,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.bluetoothDevices().then(data => console.log(data));</code></pre class="example"> si.bluetoothDevices().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -186,6 +186,7 @@ si.bluetoothDevices().then(data => console.log(data));</code></pre class="exampl
connected: true connected: true
}, },
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -194,7 +195,6 @@ si.bluetoothDevices().then(data => console.log(data));</code></pre class="exampl
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -240,7 +240,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -79,7 +79,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -91,7 +91,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -332,7 +332,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpu().then(data => console.log(data));</code></pre class="example"> si.cpu().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'Intel®', manufacturer: 'Intel®',
@ -355,6 +355,7 @@ si.cpu().then(data => console.log(data));</code></pre class="example">
virtualization: true, virtualization: true,
cache: { l1d: 262144, l1i: 262144, l2: 2097152, l3: 16777216 } cache: { l1d: 262144, l1i: 262144, l2: 2097152, l3: 16777216 }
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuFlags(cb)</td> <td>si.cpuFlags(cb)</td>
@ -371,10 +372,11 @@ si.cpu().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuFlags().then(data => console.log(data));</code></pre class="example"> si.cpuFlags().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuCache(cb)</td> <td>si.cpuCache(cb)</td>
@ -431,10 +433,11 @@ fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuCache().then(data => console.log(data));</code></pre class="example"> si.cpuCache().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ l1d: 262144, l1i: 262144, l2: 2097152, l3: 16777216 } { l1d: 262144, l1i: 262144, l2: 2097152, l3: 16777216 }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuCurrentSpeed(cb)</td> <td>si.cpuCurrentSpeed(cb)</td>
@ -491,8 +494,8 @@ si.cpuCache().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuCurrentSpeed().then(data => console.log(data));</code></pre class="example"> si.cpuCurrentSpeed().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
min: 0.86, min: 0.86,
max: 1.77, max: 1.77,
@ -505,6 +508,7 @@ si.cpuCurrentSpeed().then(data => console.log(data));</code></pre class="example
] ]
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuTemperature(cb)</td> <td>si.cpuTemperature(cb)</td>
@ -571,8 +575,8 @@ si.cpuCurrentSpeed().then(data => console.log(data));</code></pre class="example
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuTemperature().then(data => console.log(data));</code></pre class="example"> si.cpuTemperature().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
main: 34, main: 34,
cores: [ cores: [
@ -584,6 +588,7 @@ si.cpuTemperature().then(data => console.log(data));</code></pre class="example"
chipset: 49 chipset: 49
} }
</pre> </pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -611,7 +616,6 @@ si.cpuTemperature().then(data => console.log(data));</code></pre class="example"
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -1315,7 +1315,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -262,7 +262,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.diskLayout().then(data => console.log(data));</code></pre class="example"> si.diskLayout().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -295,6 +295,7 @@ si.diskLayout().then(data => console.log(data));</code></pre class="example">
... ...
} }
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.blockDevices(cb)</td> <td>si.blockDevices(cb)</td>
@ -451,7 +452,7 @@ si.diskLayout().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.blockDevices().then(data => console.log(data));</code></pre class="example"> si.blockDevices().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -474,6 +475,7 @@ si.blockDevices().then(data => console.log(data));</code></pre class="example">
... ...
} }
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.disksIO(cb)</td> <td>si.disksIO(cb)</td>
@ -624,7 +626,7 @@ setInterval(function() {
si.disksIO().then(data => { si.disksIO().then(data => {
console.log(data); console.log(data);
}) })
}, 1000)</code></pre class="example"> }, 1000)</code></pre>
<pre class="example"> <pre class="example">
{ // first call { // first call
rIO: 899825, rIO: 899825,
@ -644,6 +646,7 @@ setInterval(function() {
tIO_sec: 38.5395537525355, tIO_sec: 38.5395537525355,
ms: 986 ms: 986
}...</pre> }...</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -757,7 +760,7 @@ setInterval(function() {
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.fsSize().then(data => console.log(data));</code></pre class="example"> si.fsSize().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -774,6 +777,7 @@ si.fsSize().then(data => console.log(data));</code></pre class="example">
... ...
} }
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.fsOpenFiles(cb)</td> <td>si.fsOpenFiles(cb)</td>
@ -820,13 +824,14 @@ si.fsSize().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.fsOpenFiles().then(data => console.log(data));</code></pre class="example"> si.fsOpenFiles().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
max: 6566555, max: 6566555,
allocated: 1856, allocated: 1856,
available: 0 available: 0
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.fsStats(cb)</td> <td>si.fsStats(cb)</td>
@ -917,7 +922,7 @@ setInterval(function() {
si.fsStats().then(data => { si.fsStats().then(data => {
console.log(data); console.log(data);
}) })
}, 1000)</code></pre class="example"> }, 1000)</code></pre>
<pre class="example"> <pre class="example">
{ // first call { // first call
rx: 14015849472, rx: 14015849472,
@ -937,6 +942,7 @@ setInterval(function() {
tx_sec: 4083.748753738784, tx_sec: 4083.748753738784,
ms: 1003 ms: 1003
}...</pre> }...</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -964,7 +970,6 @@ setInterval(function() {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -169,8 +169,8 @@ valueObject = {
system: 'model, manufacturer' system: 'model, manufacturer'
} }
si.get(valueObject).then(data => console.log(data));</code></pre class="example"> si.get(valueObject).then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
cpu: { cpu: {
manufacturer: 'Intel®', manufacturer: 'Intel®',
@ -203,8 +203,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
} }
} }
</pre> </pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function within systeminformation.</p> <p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function within systeminformation.</p>
<h3>Providing parameters to the get() function</h3> <h3>Providing parameters to the get() function</h3>
@ -245,8 +245,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
valueObject = { valueObject = {
processLoad: '(postgres) pids, cpu' processLoad: '(postgres) pids, cpu'
} }
si.get(valueObject).then(data => console.log(data));</code></pre class="example"> si.get(valueObject).then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
processLoad: { processLoad: {
pids: [ pids: [
@ -258,8 +258,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
} }
} }
</pre> </pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<h3>Filter results in get() function</h3> <h3>Filter results in get() function</h3>
<p>You can get even further: if the desired result object is an array, you can filter the object to get only the wanted array item: have a look at the following example:</p> <p>You can get even further: if the desired result object is an array, you can filter the object to get only the wanted array item: have a look at the following example:</p>
@ -299,8 +299,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
valueObject = { valueObject = {
networkInterfaces: 'iface, ip4 | iface:en0' networkInterfaces: 'iface, ip4 | iface:en0'
} }
si.get(valueObject).then(data => console.log(data));</code></pre class="example"> si.get(valueObject).then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
networkInterfaces: [ networkInterfaces: [
{ {
@ -310,8 +310,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
] ]
} }
</pre> </pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<h2>Get All At Once</h2> <h2>Get All At Once</h2>
<p>The following three functions <span class="code">si.getStaticData()</span>, <span class="code">si.getDynamicData()</span> and <span class="code">si.getAllData()</span> will return most of the available data in a single result object:</p> <p>The following three functions <span class="code">si.getStaticData()</span>, <span class="code">si.getDynamicData()</span> and <span class="code">si.getAllData()</span> will return most of the available data in a single result object:</p>
@ -370,7 +370,6 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -137,7 +137,6 @@ async function cpuData() {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -572,7 +572,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.graphics().then(data => console.log(data));</code></pre class="example"> si.graphics().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
controllers: [ controllers: [
@ -607,6 +607,7 @@ si.graphics().then(data => console.log(data));</code></pre class="example">
} }
] ]
}</pre> }</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -615,7 +616,6 @@ si.graphics().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -57,6 +57,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.27.12</th>
<td>2025-12-09</td>
<td><span class="code">networkConnections()</span> fix pid issue (macOS)</td>
</tr>
<tr> <tr>
<th scope="row">5.27.11</th> <th scope="row">5.27.11</th>
<td>2025-10-05</td> <td>2025-10-05</td>
@ -3257,12 +3262,12 @@
<tr> <tr>
<th scope="row">3.23.0</th> <th scope="row">3.23.0</th>
<td>2017-06-22</td> <td>2017-06-22</td>
<td>added <span class="code">memLayout</span>, <span class="code">diskLayout</span>, extended windows support (<span class="code">inetChecksite<span class="code"></span></td> <td>added <span class="code">memLayout</span>, <span class="code">diskLayout</span>, extended windows support (<span class="code">inetChecksite</span></td>
</tr> </tr>
<tr> <tr>
<th scope="row">3.22.0</th> <th scope="row">3.22.0</th>
<td>2017-06-19</td> <td>2017-06-19</td>
<td>extended windows support (<span class="code">users<span class="code">, <span class="code">inetLatency</span>)</td> <td>extended windows support (<span class="code">users</span>, <span class="code">inetLatency</span>)</td>
</tr> </tr>
<tr> <tr>
<th scope="row">3.21.0</th> <th scope="row">3.21.0</th>
@ -3561,7 +3566,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -22,7 +22,7 @@
<title>systeminformation</title> <title>systeminformation</title>
<script> <script>
let vh = window.innerHeight * 0.01; const vh = window.innerHeight * 0.01;
// Then we set the value in the --vh custom property to the root of the document // Then we set the value in the --vh custom property to the root of the document
document.documentElement.style.setProperty('--vh', `${vh}px`); document.documentElement.style.setProperty('--vh', `${vh}px`);
@ -34,12 +34,12 @@
// }); // });
function init() { function init() {
typed(); typed();
document.querySelector('.down').addEventListener('click', function () { document.querySelector('.down').addEventListener('click', () => {
scrollIt( scrollIt(
document.querySelector('.quickstart'), document.querySelector('.quickstart'),
600, 600,
'easeOutQuad', 'easeOutQuad',
function () { () => {
console.log('READY'); console.log('READY');
} }
); );
@ -52,8 +52,8 @@
function getDownloads() { function getDownloads() {
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () { xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) { if (this.readyState === 4 && this.status === 200) {
var downloads = JSON.parse(this.responseText); const downloads = JSON.parse(this.responseText);
document.getElementById("downloads").innerHTML = numberWithCommas(downloads.downloads); document.getElementById("downloads").innerHTML = numberWithCommas(downloads.downloads);
} }
}; };
@ -63,8 +63,8 @@
function getVersion() { function getVersion() {
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () { xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) { if (this.readyState === 4 && this.status === 200) {
var packageVersion = JSON.parse(this.responseText); const packageVersion = JSON.parse(this.responseText);
document.getElementById("version").innerHTML = packageVersion.version; document.getElementById("version").innerHTML = packageVersion.version;
} }
}; };
@ -126,7 +126,7 @@
}; };
const start = window.pageYOffset; const start = window.pageYOffset;
const startTime = 'now' in window.performance ? performance.now() : new Date().getTime(); const startTime = 'now' in window.performance ? performance.now() : Date.now();
const documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight); const documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight; const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
@ -142,7 +142,7 @@
} }
function scroll() { function scroll() {
const now = 'now' in window.performance ? performance.now() : new Date().getTime(); const now = 'now' in window.performance ? performance.now() : Date.now();
const time = Math.min(1, ((now - startTime) / duration)); const time = Math.min(1, ((now - startTime) / duration));
const timeFunction = easings[easing](time); const timeFunction = easings[easing](time);
window.scroll(0, Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start)); window.scroll(0, Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start));
@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo"> <img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
3<div class="version">New Version: <span id="version">5.27.11</span></div> <div class="version">New Version: <span id="version">5.27.12</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">
@ -212,7 +212,7 @@
<div class="title">Downloads last month</div> <div class="title">Downloads last month</div>
</div> </div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12"> <div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">865</div> <div class="numbers">901</div>
<div class="title">Dependents</div> <div class="title">Dependents</div>
</div> </div>
</div> </div>
@ -395,9 +395,7 @@
<!-- Optional JavaScript --> <!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS --> <!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script> <script>
window.onload = function (e) { window.onload = init;
init();
}
</script> </script>
</body> </body>

View File

@ -95,7 +95,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -232,8 +232,8 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.mem().then(data => console.log(data));</code></pre class="example"> si.mem().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
total: 67092135936, total: 67092135936,
free: 65769291776, free: 65769291776,
@ -251,6 +251,7 @@ si.mem().then(data => console.log(data));</code></pre class="example">
dirty: 8192 dirty: 8192
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.memLayout(cb)</td> <td>si.memLayout(cb)</td>
@ -387,8 +388,8 @@ si.mem().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.memLayout().then(data => console.log(data));</code></pre class="example"> si.memLayout().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
size: 34359738368, size: 34359738368,
@ -420,6 +421,7 @@ si.memLayout().then(data => console.log(data));</code></pre class="example">
} }
] ]
</pre> </pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -428,7 +430,6 @@ si.memLayout().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -282,7 +282,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkInterfaces().then(data => console.log(data));</code></pre class="example"> si.networkInterfaces().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -333,8 +333,8 @@ si.networkInterfaces().then(data => console.log(data));</code></pre class="examp
<h5>Get Default Interface only</h5> <h5>Get Default Interface only</h5>
<p>&nbsp;&nbsp;With the 'default' parameter this function returns only the default interface</p> <p>&nbsp;&nbsp;With the 'default' parameter this function returns only the default interface</p>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkInterfaces('default').then(data => console.log(data));</code></pre class="example"> si.networkInterfaces('default').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
iface: 'en0', iface: 'en0',
ifaceName: 'en0', ifaceName: 'en0',
@ -357,6 +357,7 @@ si.networkInterfaces('default').then(data => console.log(data));</code></pre cla
ieee8021xState: '', ieee8021xState: '',
carrierChanges: 0 carrierChanges: 0
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkInterfaceDefault(cb)</td> <td>si.networkInterfaceDefault(cb)</td>
@ -373,9 +374,10 @@ si.networkInterfaces('default').then(data => console.log(data));</code></pre cla
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkInterfaceDefault().then(data => console.log(data));</code></pre class="example"> si.networkInterfaceDefault().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
eth0</pre> eth0</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkGatewayDefault(cb)</td> <td>si.networkGatewayDefault(cb)</td>
@ -392,9 +394,10 @@ eth0</pre>
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkGatewayDefault().then(data => console.log(data));</code></pre class="example"> si.networkGatewayDefault().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
192.168.0.1</pre> 192.168.0.1</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkStats(iface,cb)</td> <td>si.networkStats(iface,cb)</td>
@ -525,7 +528,7 @@ setInterval(function() {
si.networkStats().then(data => { si.networkStats().then(data => {
console.log(data); console.log(data);
}) })
}, 1000)</code></pre class="example"> }, 1000)</code></pre>
<pre class="example"> <pre class="example">
[ [
{ // first call { // first call
@ -557,6 +560,7 @@ setInterval(function() {
ms: 985 ms: 985
} }
]...</pre> ]...</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkConnections(cb)</td> <td>si.networkConnections(cb)</td>
@ -653,7 +657,7 @@ setInterval(function() {
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkConnections().then(data => console.log(data));</code></pre class="example"> si.networkConnections().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -678,6 +682,7 @@ si.networkConnections().then(data => console.log(data));</code></pre class="exam
}, },
... ...
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -751,7 +756,7 @@ si.networkConnections().then(data => console.log(data));</code></pre class="exam
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.inetChecksite('google.com').then(data => console.log(data));</code></pre class="example"> si.inetChecksite('google.com').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
url: 'google.com', url: 'google.com',
@ -759,6 +764,7 @@ si.inetChecksite('google.com').then(data => console.log(data));</code></pre clas
status: 301, status: 301,
ms: 82 ms: 82
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.inetLatency(host, cb)</td> <td>si.inetLatency(host, cb)</td>
@ -775,14 +781,15 @@ si.inetChecksite('google.com').then(data => console.log(data));</code></pre clas
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.inetLatency().then(data => console.log(data));</code></pre class="example"> si.inetLatency().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
13.484</pre> 13.484</pre>
<pre><code class="js">// Example with given host IP address <pre><code class="js">// Example with given host IP address
const si = require('systeminformation'); const si = require('systeminformation');
si.inetLatency('216.58.207.142').then(data => console.log(data));</code></pre class="example"> si.inetLatency('216.58.207.142').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
11.291</pre> 11.291</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -810,7 +817,6 @@ setInterval(function() {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -66,7 +66,6 @@
<th>Comments</th> <th>Comments</th>
</tr> </tr>
</thead> </thead>
<tbody>
<tr> <tr>
<td>si.osInfo(cb)</td> <td>si.osInfo(cb)</td>
<td>{...}</td> <td>{...}</td>
@ -242,7 +241,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.osInfo().then(data => console.log(data));</code></pre class="example"> si.osInfo().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
platform: 'darwin', platform: 'darwin',
@ -260,6 +259,7 @@ si.osInfo().then(data => console.log(data));</code></pre class="example">
servicepack: '', servicepack: '',
uefi: true uefi: true
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.shell(cb)</td> <td>si.shell(cb)</td>
@ -666,7 +666,7 @@ si.osInfo().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.versions().then(data => console.log(data));</code></pre class="example"> si.versions().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
kernel: '23.6.0', kernel: '23.6.0',
@ -710,13 +710,14 @@ si.versions().then(data => console.log(data));</code></pre class="example">
}</pre> }</pre>
<h5>Example 2</h5> <h5>Example 2</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.versions('npm, php, postgresql').then(data => console.log(data));</code></pre class="example"> si.versions('npm, php, postgresql').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
npm: '6.13.6', npm: '6.13.6',
php: '7.3.11', php: '7.3.11',
postgresql: '12.1' postgresql: '12.1'
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.users(cb)</td> <td>si.users(cb)</td>
@ -793,7 +794,7 @@ si.versions('npm, php, postgresql').then(data => console.log(data));</code></pre
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.users().then(data => console.log(data));</code></pre class="example"> si.users().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -813,15 +814,14 @@ si.users().then(data => console.log(data));</code></pre class="example">
command: '-bash' command: '-bash'
} }
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -172,7 +172,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.printer().then(data => console.log(data));</code></pre class="example"> si.printer().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -198,6 +198,7 @@ si.printer().then(data => console.log(data));</code></pre class="example">
shared: true shared: true
} }
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
@ -207,7 +208,6 @@ si.printer().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -66,7 +66,6 @@
<th>Comments</th> <th>Comments</th>
</tr> </tr>
</thead> </thead>
<tbody>
<tr> <tr>
<td>si.currentLoad(cb)</td> <td>si.currentLoad(cb)</td>
<td>{...}</td> <td>{...}</td>
@ -192,8 +191,8 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.currentLoad().then(data => console.log(data));</code></pre class="example"> si.currentLoad().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
avgLoad: 0.23, avgLoad: 0.23,
currentLoad: 4.326328800988875, currentLoad: 4.326328800988875,
@ -232,6 +231,7 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
... ...
] ]
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.fullLoad(cb)</td> <td>si.fullLoad(cb)</td>
@ -498,8 +498,8 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.processes().then(data => console.log(data));</code></pre class="example"> si.processes().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
all: 258, all: 258,
running: 1, running: 1,
@ -530,6 +530,7 @@ si.processes().then(data => console.log(data));</code></pre class="example">
... ...
] ]
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.processLoad('nginx, ssl',cb)</td> <td>si.processLoad('nginx, ssl',cb)</td>
@ -596,8 +597,8 @@ si.processes().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.processLoad('nginx, postgres').then(data => console.log(data));</code></pre class="example"> si.processLoad('nginx, postgres').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
proc: 'nginx', proc: 'nginx',
@ -625,6 +626,7 @@ si.processLoad('nginx, postgres').then(data => console.log(data));</code></pre c
mem: 0 mem: 0
}, },
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.services('mysql, apache2', cb)</td> <td>si.services('mysql, apache2', cb)</td>
@ -701,8 +703,8 @@ si.processLoad('nginx, postgres').then(data => console.log(data));</code></pre c
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.services('mysql, postgres').then(data => console.log(data));</code></pre class="example"> si.services('mysql, postgres').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
name: 'mysql', name: 'mysql',
@ -721,8 +723,8 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre clas
mem: 0 mem: 0
}, },
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<h4>Getting correct stats values</h4> <h4>Getting correct stats values</h4>
@ -748,7 +750,6 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre clas
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -243,7 +243,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -114,9 +114,10 @@ let observer = si.observe(valueObject, 1000, usersCallback);
// In this example we stop our observer function after 30 seconds // In this example we stop our observer function after 30 seconds
setTimeout(() => { setTimeout(() => {
clearInterval(observer) clearInterval(observer)
}, 30000);</code></pre class="example"> }, 30000);</code></pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function in systeminformation.</p> <p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function in systeminformation.</p>
@ -125,7 +126,6 @@ setTimeout(() => {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -172,8 +172,8 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.system().then(data => console.log(data));</code></pre class="example"> si.system().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'Apple Inc.', manufacturer: 'Apple Inc.',
model: 'MacBookPro13,2', model: 'MacBookPro13,2',
@ -184,6 +184,7 @@ si.system().then(data => console.log(data));</code></pre class="example">
virtual: false, virtual: false,
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.uuid(cb)</td> <td>si.uuid(cb)</td>
@ -230,8 +231,8 @@ si.system().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.uuid().then(data => console.log(data));</code></pre class="example"> si.uuid().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
os: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', os: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
hardware: 'xxxxxxxxxxxxxx', hardware: 'xxxxxxxxxxxxxx',
@ -242,6 +243,7 @@ si.uuid().then(data => console.log(data));</code></pre class="example">
] ]
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.bios(cb)</td> <td>si.bios(cb)</td>
@ -328,8 +330,8 @@ si.uuid().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.bios().then(data => console.log(data));</code></pre class="example"> si.bios().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
vendor: 'American Megatrends Inc.', vendor: 'American Megatrends Inc.',
version: 'P4.20', version: 'P4.20',
@ -349,6 +351,7 @@ si.bios().then(data => console.log(data));</code></pre class="example">
'UEFI' 'UEFI'
] ]
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.baseboard(cb)</td> <td>si.baseboard(cb)</td>
@ -435,8 +438,8 @@ si.bios().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.baseboard().then(data => console.log(data));</code></pre class="example"> si.baseboard().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'ASRock', manufacturer: 'ASRock',
model: 'H310M-STX', model: 'H310M-STX',
@ -446,6 +449,7 @@ si.baseboard().then(data => console.log(data));</code></pre class="example">
memMax: 68719476736 memMax: 68719476736
memSlots: 2 memSlots: 2
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.chassis(cb)</td> <td>si.chassis(cb)</td>
@ -532,8 +536,8 @@ si.baseboard().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.chassis().then(data => console.log(data));</code></pre class="example"> si.chassis().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'Apple Inc.', manufacturer: 'Apple Inc.',
model: 'MacBookPro13,2', model: 'MacBookPro13,2',
@ -543,6 +547,7 @@ si.chassis().then(data => console.log(data));</code></pre class="example">
assetTag: 'Mac-99878xxxx...', assetTag: 'Mac-99878xxxx...',
sku: 'A1706' sku: 'A1706'
}</pre> }</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -551,7 +556,6 @@ si.chassis().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -111,7 +111,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -87,7 +87,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -182,7 +182,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.usb().then(data => console.log(data));</code></pre class="example"> si.usb().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -233,6 +233,7 @@ si.usb().then(data => console.log(data));</code></pre class="example">
maxPower: '100mA', maxPower: '100mA',
serialNumber: null } serialNumber: null }
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
@ -242,7 +243,6 @@ si.usb().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -231,7 +231,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.battery().then(data => console.log(data));</code></pre class="example"> si.battery().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
hasbattery: true, hasbattery: true,
@ -250,6 +250,7 @@ si.battery().then(data => console.log(data));</code></pre class="example">
manufacturer: 'Apple', manufacturer: 'Apple',
serial: 'F9Y19860Y9AH9XBAX' serial: 'F9Y19860Y9AH9XBAX'
}</pre> }</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -265,7 +266,6 @@ si.battery().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -75,7 +75,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -69,7 +69,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -311,7 +311,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpu().then(data => console.log(data));</code></pre class="example"> si.cpu().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'Intel®', manufacturer: 'Intel®',
@ -333,6 +333,7 @@ si.cpu().then(data => console.log(data));</code></pre class="example">
cache: { l1d: 262144, l1i: 262144, l2: 2, l3: 16 }, cache: { l1d: 262144, l1i: 262144, l2: 2, l3: 16 },
flags: 'fpu vme de pse ...' flags: 'fpu vme de pse ...'
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuFlags(cb)</td> <td>si.cpuFlags(cb)</td>
@ -349,10 +350,11 @@ si.cpu().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuFlags().then(data => console.log(data));</code></pre class="example"> si.cpuFlags().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuCache(cb)</td> <td>si.cpuCache(cb)</td>
@ -409,10 +411,11 @@ fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuCache().then(data => console.log(data));</code></pre class="example"> si.cpuCache().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ l1d: 262144, l1i: 262144, l2: 2, l3: 16 } { l1d: 262144, l1i: 262144, l2: 2, l3: 16 }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuCurrentspeed(cb)</td> <td>si.cpuCurrentspeed(cb)</td>
@ -469,8 +472,8 @@ si.cpuCache().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuCurrentspeed().then(data => console.log(data));</code></pre class="example"> si.cpuCurrentspeed().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
min: 0.86, min: 0.86,
max: 1.77, max: 1.77,
@ -483,6 +486,7 @@ si.cpuCurrentspeed().then(data => console.log(data));</code></pre class="example
] ]
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.cpuTemperature(cb)</td> <td>si.cpuTemperature(cb)</td>
@ -529,10 +533,11 @@ si.cpuCurrentspeed().then(data => console.log(data));</code></pre class="example
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.cpuTemperature().then(data => console.log(data));</code></pre class="example"> si.cpuTemperature().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ main: 42, cores: [], max: 42 } { main: 42, cores: [], max: 42 }
</pre> </pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -558,7 +563,6 @@ si.cpuTemperature().then(data => console.log(data));</code></pre class="example"
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -1043,7 +1043,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -251,7 +251,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.diskLayout().then(data => console.log(data));</code></pre class="example"> si.diskLayout().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -284,6 +284,7 @@ si.diskLayout().then(data => console.log(data));</code></pre class="example">
... ...
} }
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.blockDevices(cb)</td> <td>si.blockDevices(cb)</td>
@ -420,7 +421,7 @@ si.diskLayout().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.blockDevices().then(data => console.log(data));</code></pre class="example"> si.blockDevices().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -442,6 +443,7 @@ si.blockDevices().then(data => console.log(data));</code></pre class="example">
... ...
} }
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.disksIO(cb)</td> <td>si.disksIO(cb)</td>
@ -532,7 +534,7 @@ setInterval(function() {
si.disksIO().then(data => { si.disksIO().then(data => {
console.log(data); console.log(data);
}) })
}, 1000)</code></pre class="example"> }, 1000)</code></pre>
<pre class="example"> <pre class="example">
{ // first call { // first call
rIO: 899825, rIO: 899825,
@ -552,6 +554,7 @@ setInterval(function() {
tIO_sec: 38.5395537525355, tIO_sec: 38.5395537525355,
ms: 986 ms: 986
}...</pre> }...</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -645,7 +648,7 @@ setInterval(function() {
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.fsSize().then(data => console.log(data));</code></pre class="example"> si.fsSize().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -660,6 +663,7 @@ si.fsSize().then(data => console.log(data));</code></pre class="example">
... ...
} }
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.fsOpenFiles(cb)</td> <td>si.fsOpenFiles(cb)</td>
@ -706,13 +710,14 @@ si.fsSize().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.fsOpenFiles().then(data => console.log(data));</code></pre class="example"> si.fsOpenFiles().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
max: 6566555, max: 6566555,
allocated: 1856, allocated: 1856,
available: 0 available: 0
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.fsStats(cb)</td> <td>si.fsStats(cb)</td>
@ -803,7 +808,7 @@ setInterval(function() {
si.fsStats().then(data => { si.fsStats().then(data => {
console.log(data); console.log(data);
}) })
}, 1000)</code></pre class="example"> }, 1000)</code></pre>
<pre class="example"> <pre class="example">
{ // first call { // first call
rx: 14015849472, rx: 14015849472,
@ -823,6 +828,7 @@ setInterval(function() {
tx_sec: 4083.748753738784, tx_sec: 4083.748753738784,
ms: 1003 ms: 1003
}...</pre> }...</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -850,7 +856,6 @@ setInterval(function() {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -168,8 +168,8 @@ valueObject = {
system: 'model, manufacturer' system: 'model, manufacturer'
} }
si.get(valueObject).then(data => console.log(data));</code></pre class="example"> si.get(valueObject).then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
cpu: { cpu: {
manufacturer: 'Intel®', manufacturer: 'Intel®',
@ -200,8 +200,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
} }
} }
</pre> </pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function within systeminformation.</p> <p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function within systeminformation.</p>
<h3>Providing parameters to the get() function</h3> <h3>Providing parameters to the get() function</h3>
@ -242,8 +242,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
valueObject = { valueObject = {
processLoad: 'pids, cpu (postgres)' processLoad: 'pids, cpu (postgres)'
} }
si.get(valueObject).then(data => console.log(data));</code></pre class="example"> si.get(valueObject).then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
processLoad: { processLoad: {
pids: [ pids: [
@ -255,8 +255,8 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
} }
} }
</pre> </pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<h2>Get All At Once</h2> <h2>Get All At Once</h2>
<p>The following three functions <span class="code">si.getStaticData()</span>, <span class="code">si.getDynamicData()</span> and <span class="code">si.getAllData()</span> will return most of the available data in a single result object:</p> <p>The following three functions <span class="code">si.getStaticData()</span>, <span class="code">si.getDynamicData()</span> and <span class="code">si.getAllData()</span> will return most of the available data in a single result object:</p>
@ -315,7 +315,6 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -130,7 +130,7 @@ async function cpuData() {
}</code></pre><br> }</code></pre><br>
<p><strong>Issues</strong></p> <p><strong>Issues</strong></p>
<p>If you discover some empty or incorrect values, please be sure to first have a look at the <a href="issues.html">Known issues</a> section.</p> <p>If you discover some empty or incorrect values, please be sure to first have a look at the <a href="issues.html">Known issues</a> section.</p>
</div> </p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -471,7 +471,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.graphics().then(data => console.log(data));</code></pre class="example"> si.graphics().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
controllers: [ controllers: [
@ -503,6 +503,7 @@ si.graphics().then(data => console.log(data));</code></pre class="example">
} }
] ]
}</pre> }</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -511,7 +512,6 @@ si.graphics().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -1804,12 +1804,12 @@
<tr> <tr>
<th scope="row">3.23.0</th> <th scope="row">3.23.0</th>
<td>2017-06-22</td> <td>2017-06-22</td>
<td>added <span class="code">memLayout</span>, <span class="code">diskLayout</span>, extended windows support (<span class="code">inetChecksite<span class="code"></span></td> <td>added <span class="code">memLayout</span>, <span class="code">diskLayout</span>, extended windows support (<span class="code">inetChecksite</span></td>
</tr> </tr>
<tr> <tr>
<th scope="row">3.22.0</th> <th scope="row">3.22.0</th>
<td>2017-06-19</td> <td>2017-06-19</td>
<td>extended windows support (<span class="code">users<span class="code">, <span class="code">inetLatency</span>)</td> <td>extended windows support (<span class="code">users, inetLatency</span>)</td>
</tr> </tr>
<tr> <tr>
<th scope="row">3.21.0</th> <th scope="row">3.21.0</th>
@ -2108,7 +2108,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -51,8 +51,8 @@
function getDownloads() { function getDownloads() {
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () { xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) { if (this.readyState === 4 && this.status === 200) {
var downloads = JSON.parse(this.responseText); let downloads = JSON.parse(this.responseText);
document.getElementById("downloads").innerHTML = numberWithCommas(downloads.downloads); document.getElementById("downloads").innerHTML = numberWithCommas(downloads.downloads);
} }
}; };
@ -62,8 +62,8 @@
function getVersion() { function getVersion() {
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () { xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) { if (this.readyState === 4 && this.status === 200) {
var packageVersion = JSON.parse(this.responseText); const packageVersion = JSON.parse(this.responseText);
document.getElementById("version").innerHTML = packageVersion.version; document.getElementById("version").innerHTML = packageVersion.version;
} }
}; };
@ -71,7 +71,7 @@
xhttp.send(); xhttp.send();
} }
function typed() { function typed() {
var options = { const options = {
strings: ["System and OS information library for node.js", "Get detailed hardware, system &amp; OS information.", "For Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, SunOS"], strings: ["System and OS information library for node.js", "Get detailed hardware, system &amp; OS information.", "For Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, SunOS"],
typeSpeed: 60, typeSpeed: 60,
loop: false, loop: false,

View File

@ -89,7 +89,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -201,8 +201,8 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.mem().then(data => console.log(data));</code></pre class="example"> si.mem().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
total: 67092135936, total: 67092135936,
free: 65769291776, free: 65769291776,
@ -218,6 +218,7 @@ si.mem().then(data => console.log(data));</code></pre class="example">
swapfree: 8589930496 swapfree: 8589930496
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.memLayout(cb)</td> <td>si.memLayout(cb)</td>
@ -344,8 +345,8 @@ si.mem().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.memLayout().then(data => console.log(data));</code></pre class="example"> si.memLayout().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
size: 34359738368, size: 34359738368,
@ -375,6 +376,7 @@ si.memLayout().then(data => console.log(data));</code></pre class="example">
} }
] ]
</pre> </pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -383,7 +385,6 @@ si.memLayout().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -271,7 +271,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkInterfaces().then(data => console.log(data));</code></pre class="example"> si.networkInterfaces().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -317,6 +317,7 @@ si.networkInterfaces().then(data => console.log(data));</code></pre class="examp
carrierChanges: 0 carrierChanges: 0
}, ... }, ...
]</pre> ]</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkInterfaceDefault(cb)</td> <td>si.networkInterfaceDefault(cb)</td>
@ -333,9 +334,10 @@ si.networkInterfaces().then(data => console.log(data));</code></pre class="examp
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkInterfaceDefault().then(data => console.log(data));</code></pre class="example"> si.networkInterfaceDefault().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
eth0</pre> eth0</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkGatewayDefault(cb)</td> <td>si.networkGatewayDefault(cb)</td>
@ -352,9 +354,10 @@ eth0</pre>
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkGatewayDefault().then(data => console.log(data));</code></pre class="example"> si.networkGatewayDefault().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
192.168.0.1</pre> 192.168.0.1</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkStats(iface,cb)</td> <td>si.networkStats(iface,cb)</td>
@ -485,7 +488,7 @@ setInterval(function() {
si.networkStats().then(data => { si.networkStats().then(data => {
console.log(data); console.log(data);
}) })
}, 1000)</code></pre class="example"> }, 1000)</code></pre>
<pre class="example"> <pre class="example">
[ [
{ // first call { // first call
@ -517,6 +520,7 @@ setInterval(function() {
ms: 985 ms: 985
} }
]...</pre> ]...</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.networkConnections(cb)</td> <td>si.networkConnections(cb)</td>
@ -613,7 +617,7 @@ setInterval(function() {
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.networkConnections().then(data => console.log(data));</code></pre class="example"> si.networkConnections().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -638,6 +642,7 @@ si.networkConnections().then(data => console.log(data));</code></pre class="exam
}, },
... ...
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -711,7 +716,7 @@ si.networkConnections().then(data => console.log(data));</code></pre class="exam
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.inetChecksite('google.com').then(data => console.log(data));</code></pre class="example"> si.inetChecksite('google.com').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
url: 'google.com', url: 'google.com',
@ -719,6 +724,7 @@ si.inetChecksite('google.com').then(data => console.log(data));</code></pre clas
status: 301, status: 301,
ms: 82 ms: 82
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.inetLatency(host, cb)</td> <td>si.inetLatency(host, cb)</td>
@ -735,14 +741,15 @@ si.inetChecksite('google.com').then(data => console.log(data));</code></pre clas
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.inetLatency().then(data => console.log(data));</code></pre class="example"> si.inetLatency().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
13.484</pre> 13.484</pre>
<pre><code class="js">// Example with given host IP address <pre><code class="js">// Example with given host IP address
const si = require('systeminformation'); const si = require('systeminformation');
si.inetLatency('216.58.207.142').then(data => console.log(data));</code></pre class="example"> si.inetLatency('216.58.207.142').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
11.291</pre> 11.291</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -770,7 +777,6 @@ setInterval(function() {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -221,7 +221,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.osInfo().then(data => console.log(data));</code></pre class="example"> si.osInfo().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
platform: 'darwin', platform: 'darwin',
@ -239,6 +239,7 @@ si.osInfo().then(data => console.log(data));</code></pre class="example">
servicepack: '', servicepack: '',
uefi: true uefi: true
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.uuid(cb)</td> <td>si.uuid(cb)</td>
@ -565,7 +566,7 @@ si.osInfo().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.versions().then(data => console.log(data));</code></pre class="example"> si.versions().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
kernel: '19.3.0', kernel: '19.3.0',
@ -601,13 +602,14 @@ si.versions().then(data => console.log(data));</code></pre class="example">
}</pre> }</pre>
<h5>Example 2</h5> <h5>Example 2</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.versions('npm, php, postgresql').then(data => console.log(data));</code></pre class="example"> si.versions('npm, php, postgresql').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
npm: '6.13.6', npm: '6.13.6',
php: '7.3.11', php: '7.3.11',
postgresql: '12.1' postgresql: '12.1'
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.users(cb)</td> <td>si.users(cb)</td>
@ -684,7 +686,7 @@ si.versions('npm, php, postgresql').then(data => console.log(data));</code></pre
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.users().then(data => console.log(data));</code></pre class="example"> si.users().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -704,6 +706,7 @@ si.users().then(data => console.log(data));</code></pre class="example">
command: '-bash' command: '-bash'
} }
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -712,7 +715,6 @@ si.users().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -171,8 +171,8 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.currentLoad().then(data => console.log(data));</code></pre class="example"> si.currentLoad().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
avgload: 0.23, avgload: 0.23,
currentload: 4.326328800988875, currentload: 4.326328800988875,
@ -205,6 +205,7 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
... ...
] ]
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.fullLoad(cb)</td> <td>si.fullLoad(cb)</td>
@ -471,8 +472,8 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.processes().then(data => console.log(data));</code></pre class="example"> si.processes().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
all: 258, all: 258,
running: 1, running: 1,
@ -503,6 +504,7 @@ si.processes().then(data => console.log(data));</code></pre class="example">
... ...
] ]
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.processLoad('nginx',cb)</td> <td>si.processLoad('nginx',cb)</td>
@ -569,8 +571,8 @@ si.processes().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.processLoad('nginx').then(data => console.log(data));</code></pre class="example"> si.processLoad('nginx').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
proc: 'nginx', proc: 'nginx',
pid: 11267, pid: 11267,
@ -585,6 +587,7 @@ si.processLoad('nginx').then(data => console.log(data));</code></pre class="exam
cpu: 0.01, cpu: 0.01,
mem: 0 mem: 0
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.services('mysql, apache2', cb)</td> <td>si.services('mysql, apache2', cb)</td>
@ -661,8 +664,8 @@ si.processLoad('nginx').then(data => console.log(data));</code></pre class="exam
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.services('mysql, postgres').then(data => console.log(data));</code></pre class="example"> si.services('mysql, postgres').then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
name: 'mysql', name: 'mysql',
@ -681,6 +684,7 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre clas
pmem: 0 pmem: 0
}, },
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -708,7 +712,6 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre clas
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -152,7 +152,7 @@
<br> <br>
<h2>Command Injection Vulnerability</h2> <h2>Command Injection Vulnerability</h2>
<p><span class="bold">Affected versions:</span> <p><span class="bold">Affected versions:</span>
< 4.31.1<br> &lt; 4.31.1<br>
<span class="bold">Date:</span> 2020-12-11<br> <span class="bold">Date:</span> 2020-12-11<br>
<span class="bold">CVE indentifier</span> CVE-2020-26274, CVE-2020-28448 <span class="bold">CVE indentifier</span> CVE-2020-26274, CVE-2020-28448
</p> </p>
@ -169,7 +169,7 @@
<br> <br>
<h2>Command Injection Vulnerability - prototype pollution</h2> <h2>Command Injection Vulnerability - prototype pollution</h2>
<p><span class="bold">Affected versions:</span> <p><span class="bold">Affected versions:</span>
< 4.30.5<br> &lt; 4.30.5<br>
<span class="bold">Date:</span> 2020-11-26<br> <span class="bold">Date:</span> 2020-11-26<br>
<span class="bold">CVE indentifier</span> CVE-2020-26245 <span class="bold">CVE indentifier</span> CVE-2020-26245
</p> </p>
@ -186,7 +186,7 @@
<br> <br>
<h2>Command Injection Vulnerability</h2> <h2>Command Injection Vulnerability</h2>
<p><span class="bold">Affected versions:</span> <p><span class="bold">Affected versions:</span>
< 4.27.11<br> &lt; 4.27.11<br>
<span class="bold">Date:</span> 2020-10-26<br> <span class="bold">Date:</span> 2020-10-26<br>
<span class="bold">CVE indentifier</span> CVE-2020-7752 <span class="bold">CVE indentifier</span> CVE-2020-7752
</p> </p>
@ -205,7 +205,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -113,9 +113,9 @@ let observer = si.observe(valueObject, 1000, usersCallback);
// In this example we stop our observer function after 30 seconds // In this example we stop our observer function after 30 seconds
setTimeout(() => { setTimeout(() => {
clearInterval(observer) clearInterval(observer)
}, 30000);</code></pre class="example"> }, 30000);</code></pre>
</td>
</tr> </tr>
</tbody>
</table> </table>
<p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function in systeminformation.</p> <p>The key names of the <span class="code">valueObject</span> must be exactly the same as the representing function in systeminformation.</p>
@ -124,7 +124,6 @@ setTimeout(() => {
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -161,8 +161,8 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.system().then(data => console.log(data));</code></pre class="example"> si.system().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'Apple Inc.', manufacturer: 'Apple Inc.',
model: 'MacBookPro13,2', model: 'MacBookPro13,2',
@ -173,6 +173,7 @@ si.system().then(data => console.log(data));</code></pre class="example">
virtual: false, virtual: false,
} }
</pre> </pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.bios(cb)</td> <td>si.bios(cb)</td>
@ -229,14 +230,15 @@ si.system().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.bios().then(data => console.log(data));</code></pre class="example"> si.bios().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
vendor: 'American Megatrends Inc.', vendor: 'American Megatrends Inc.',
version: 'P4.20', version: 'P4.20',
releaseDate: '2019-09-05', releaseDate: '2019-09-05',
revision: '5.13' revision: '5.13'
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.baseboard(cb)</td> <td>si.baseboard(cb)</td>
@ -303,8 +305,8 @@ si.bios().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.baseboard().then(data => console.log(data));</code></pre class="example"> si.baseboard().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'ASRock', manufacturer: 'ASRock',
model: 'H310M-STX', model: 'H310M-STX',
@ -312,6 +314,7 @@ si.baseboard().then(data => console.log(data));</code></pre class="example">
serial: 'C80-xxxxxxxxxxx', serial: 'C80-xxxxxxxxxxx',
assetTag: '' assetTag: ''
}</pre> }</pre>
</td>
</tr> </tr>
<tr> <tr>
<td>si.chassis(cb)</td> <td>si.chassis(cb)</td>
@ -398,8 +401,8 @@ si.baseboard().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.chassis().then(data => console.log(data));</code></pre class="example"> si.chassis().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
{ {
manufacturer: 'Apple Inc.', manufacturer: 'Apple Inc.',
model: 'MacBookPro13,2', model: 'MacBookPro13,2',
@ -409,6 +412,7 @@ si.chassis().then(data => console.log(data));</code></pre class="example">
assetTag: 'Mac-99878xxxx...', assetTag: 'Mac-99878xxxx...',
sku: '' sku: ''
}</pre> }</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -417,7 +421,6 @@ si.chassis().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -75,7 +75,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -443,7 +443,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -174,14 +174,14 @@
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td>array of RDN flags <td>array of RDN flags</td>
</tr> </tr>
<tr class="example"> <tr class="example">
<td></td> <td></td>
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.wifiNetworks().then(data => console.log(data));</code></pre class="example"> si.wifiNetworks().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -210,8 +210,8 @@ si.wifiNetworks().then(data => console.log(data));</code></pre class="example">
}, },
... ...
]</pre> ]</pre>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -220,7 +220,6 @@ si.wifiNetworks().then(data => console.log(data));</code></pre class="example">
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -444,7 +444,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
</div> </div>
<footer class="container-fluid footer"> <footer class="container-fluid footer">

View File

@ -182,7 +182,7 @@
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.wifiNetworks().then(data => console.log(data));</code></pre class="example"> si.wifiNetworks().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -296,7 +296,7 @@ si.wifiNetworks().then(data => console.log(data));</code></pre class="example">
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.wifiInterfaces().then(data => console.log(data));</code></pre class="example"> si.wifiInterfaces().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {
@ -463,7 +463,7 @@ si.wifiInterfaces().then(data => console.log(data));</code></pre class="example"
<td colspan="7"> <td colspan="7">
<h5>Example</h5> <h5>Example</h5>
<pre><code class="js">const si = require('systeminformation'); <pre><code class="js">const si = require('systeminformation');
si.wifiConnections().then(data => console.log(data));</code></pre class="example"> si.wifiConnections().then(data => console.log(data));</code></pre>
<pre class="example"> <pre class="example">
[ [
{ {

View File

@ -1563,7 +1563,7 @@ function networkConnections(callback) {
lines.shift(); lines.shift();
let pidPos = 8; let pidPos = 8;
if (lines.length > 1 && lines[0].indexOf('pid') > 0) { if (lines.length > 1 && lines[0].indexOf('pid') > 0) {
const header = (lines.shift() || '').replace(/ Address/g, '_Address').replace(/ +/g, ' ').split(' '); const header = (lines.shift() || '').replace(/ Address/g, '_Address').replace(/process:/g, "").replace(/ +/g, ' ').split(' ');
pidPos = header.indexOf('pid'); pidPos = header.indexOf('pid');
} }
lines.forEach(function (line) { lines.forEach(function (line) {
@ -1587,7 +1587,17 @@ function networkConnections(callback) {
} }
const hasState = states.indexOf(line[5]) >= 0; const hasState = states.indexOf(line[5]) >= 0;
let connstate = hasState ? line[5] : 'UNKNOWN'; let connstate = hasState ? line[5] : 'UNKNOWN';
let pid = parseInt(line[pidPos + (hasState ? 0 : -1)], 10); let pidField = "";
if (line[line.length - 9].indexOf(":") >= 0) {
pidField = line[line.length - 9].split(":")[1];
} else {
pidField = line[pidPos + (hasState ? 0 : -1)];
if (pidField.indexOf(":") >= 0) {
pidField = pidField.split(":")[1];
}
}
let pid = parseInt(pidField, 10);
if (connstate) { if (connstate) {
result.push({ result.push({
protocol: line[0], protocol: line[0],