systeminformation 5.12.0 → 5.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/cpu.js +16 -4
- package/lib/network.js +3 -1
- package/lib/processes.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -904,7 +904,7 @@ To be able to measure temperature on macOS I created a little additional package
|
|
|
904
904
|
in NPM with `optionalDependencies` I unfortunately was getting unexpected warnings on other platforms.
|
|
905
905
|
So I decided to drop this optional dependency for macOS - so by default, you will not get correct values.
|
|
906
906
|
|
|
907
|
-
This additional package
|
|
907
|
+
This additional package is now also supporting Apple Silicon M1 machines.
|
|
908
908
|
|
|
909
909
|
But if you need to detect macOS temperature just run the following additional
|
|
910
910
|
installation command:
|
|
@@ -1009,7 +1009,7 @@ OSX Temperature: credits here are going to:
|
|
|
1009
1009
|
Linux is a registered trademark of Linus Torvalds. Apple, macOS, OS X are registered trademarks of Apple Inc.,
|
|
1010
1010
|
Windows is a registered trademark of Microsoft Corporation. Node.js is a trademark of Joyent Inc.,
|
|
1011
1011
|
Intel is a trademark of Intel Corporation, AMD is a trademark of Advanced Micro Devices Inc.,
|
|
1012
|
-
Raspberry Pi is a trademark of the Raspberry Pi Foundation, Debian is a trademark
|
|
1012
|
+
Raspberry Pi is a trademark of the Raspberry Pi Foundation, Debian is a trademark owned by Software in the Public Interest, Inc.,
|
|
1013
1013
|
Ubuntu is a trademark of Canonical Ltd., FreeBSD is a registered trademark of The FreeBSD Foundation,
|
|
1014
1014
|
NetBSD is a registered trademark of The NetBSD Foundation, Docker is a trademark of Docker, Inc., Sun,
|
|
1015
1015
|
Solaris, OpenSolaris and registered trademarks of Sun Microsystems, VMware is a trademark of VMware Inc,
|
package/lib/cpu.js
CHANGED
|
@@ -714,10 +714,10 @@ function getCpu() {
|
|
|
714
714
|
const threadsPerCore = util.getValue(lines, 'thread(s) per core') || '1';
|
|
715
715
|
// const coresPerSocketInt = parseInt(util.getValue(lines, 'cores(s) per socket') || '1', 10);
|
|
716
716
|
const processors = util.getValue(lines, 'socket(s)') || '1';
|
|
717
|
-
let threadsPerCoreInt = parseInt(threadsPerCore, 10);
|
|
718
|
-
let processorsInt = parseInt(processors, 10) || 1;
|
|
719
|
-
const cpus = (parseInt(util.getValue(lines, 'cpu(s)'), 10) || 1);
|
|
720
|
-
const coresPerSocket = parseInt(util.getValue(lines, 'core(s) per socket'), 10);
|
|
717
|
+
let threadsPerCoreInt = parseInt(threadsPerCore, 10); // threads per code (normally only for performance cores)
|
|
718
|
+
let processorsInt = parseInt(processors, 10) || 1; // number of sockets / processor units in machine (normally 1)
|
|
719
|
+
// const cpus = (parseInt(util.getValue(lines, 'cpu(s)'), 10) || 1); // overall number of cores (e.g. 24 on i12900)
|
|
720
|
+
const coresPerSocket = parseInt(util.getValue(lines, 'core(s) per socket'), 10); // number of cores (e.g. 16 on i12900)
|
|
721
721
|
result.physicalCores = coresPerSocket ? coresPerSocket * processorsInt : result.cores / threadsPerCoreInt;
|
|
722
722
|
result.performanceCores = threadsPerCoreInt > 1 ? result.cores - result.physicalCores : result.cores;
|
|
723
723
|
result.efficiencyCores = threadsPerCoreInt > 1 ? result.cores - (threadsPerCoreInt * result.performanceCores) : 0;
|
|
@@ -1204,6 +1204,18 @@ function cpuTemperature(callback) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
if (osxTemp) {
|
|
1206
1206
|
result = osxTemp.cpuTemperature();
|
|
1207
|
+
// round to 2 digits
|
|
1208
|
+
if (result.main) {
|
|
1209
|
+
result.main = Math.round(result.main * 100) / 100;
|
|
1210
|
+
}
|
|
1211
|
+
if (result.max) {
|
|
1212
|
+
result.max = Math.round(result.max * 100) / 100;
|
|
1213
|
+
}
|
|
1214
|
+
if (result.cores && result.cores.length) {
|
|
1215
|
+
for (let i = 0; i < result.cores.length; i++) {
|
|
1216
|
+
result.cores[i] = Math.round(result.cores[i] * 100) / 100;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1207
1219
|
}
|
|
1208
1220
|
|
|
1209
1221
|
if (callback) { callback(result); }
|
package/lib/network.js
CHANGED
|
@@ -494,7 +494,9 @@ function parseLinesDarwinNics(sections) {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';
|
|
497
|
-
|
|
497
|
+
const operstate = util.getValue(section, 'status').toLowerCase();
|
|
498
|
+
nic.operstate = (operstate === 'active' ? 'up' : (operstate === 'inactive' ? 'down' : 'unknown'));
|
|
499
|
+
// nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down';
|
|
498
500
|
nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';
|
|
499
501
|
if (nic.ip6 || nic.ip4 || nic.mac) {
|
|
500
502
|
nics.push(nic);
|
package/lib/processes.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.3",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|