systeminformation 5.25.11 → 5.26.1
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 +23 -12
- package/lib/cpu.js +22 -13
- package/lib/graphics.js +2 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +9 -1
- package/lib/util.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,18 +35,19 @@ lines of code, > 650 versions published, up to 8 mio downloads per month, > 330
|
|
|
35
35
|
mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who
|
|
36
36
|
contributed to this project!
|
|
37
37
|
|
|
38
|
-
> **Upcoming Version 6**
|
|
38
|
+
> **Upcoming Version 6** ⭐️⭐️⭐️
|
|
39
39
|
>
|
|
40
|
-
>
|
|
41
|
-
>
|
|
40
|
+
> The upcoming version 6 of this package (written completely in TypeScript) will
|
|
41
|
+
> come with a lot of new features and improvements. I also cleaned up the API so
|
|
42
|
+
> there will also be some breaking changes. I will release the first beta soon.
|
|
42
43
|
|
|
43
44
|
## Please support this project ... ☕️
|
|
44
45
|
|
|
45
|
-
Over the past few years I spent **more than 3.000 hours** working on
|
|
46
|
-
project and invested in hardware to be able to test on different platforms.
|
|
46
|
+
Over the past few years I spent **more than 3.000 hours** working 💻 😓 ☕️ on
|
|
47
|
+
this project and invested in hardware to be able to test on different platforms.
|
|
47
48
|
Currently I am working very hard on the next **new version 6.0** completely
|
|
48
49
|
rewritten in TypeScript and with a lot of new features. Any support is highly
|
|
49
|
-
appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo)
|
|
50
|
+
appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo)... ☕️
|
|
50
51
|
|
|
51
52
|
**Your contribution** make it possible for me to keep working on this project,
|
|
52
53
|
add new features and support more platforms. Thank you in advance!
|
|
@@ -60,9 +61,9 @@ was not correct but this is now fixed with Deno >= 2.1.5.
|
|
|
60
61
|
**Attention**: This library is supposed to be used as a backend/server-side
|
|
61
62
|
library and **will definitely not work within a browser**.
|
|
62
63
|
|
|
63
|
-
##
|
|
64
|
+
## Current Version 5.0
|
|
64
65
|
|
|
65
|
-
The
|
|
66
|
+
The current Version 5 - this major version release 5.0 - came with new
|
|
66
67
|
functionality and several improvements and changes (some of them are breaking
|
|
67
68
|
changes!):
|
|
68
69
|
|
|
@@ -82,9 +83,9 @@ changes!):
|
|
|
82
83
|
examples [systeminformation.io][systeminformation-url]
|
|
83
84
|
- lot of minor improvements
|
|
84
85
|
|
|
85
|
-
Breaking Changes in version 5: you will see several
|
|
86
|
-
sake of a more consistent API interface and to be
|
|
87
|
-
[detailed version 5 changes][changes5-url].
|
|
86
|
+
Breaking Changes in version 5 (compared to version 4.x): you will see several
|
|
87
|
+
breaking changes for the sake of a more consistent API interface and to be
|
|
88
|
+
future proof. Read the [detailed version 5 changes][changes5-url].
|
|
88
89
|
|
|
89
90
|
I did a lot of testing on different platforms and machines but of course there
|
|
90
91
|
might be some issues that I am not aware of. I would be happy if you inform me
|
|
@@ -162,6 +163,7 @@ si.cpu()
|
|
|
162
163
|
|
|
163
164
|
(last 7 major and minor version releases)
|
|
164
165
|
|
|
166
|
+
- Version 5.26.0: `getStatic()`, `getAll()` added usb, audio, bluetooth, printer
|
|
165
167
|
- Version 5.25.0: `versions()` added homebrew
|
|
166
168
|
- Version 5.24.0: `versions()` added bun and deno
|
|
167
169
|
- Version 5.23.0: `usb()` added serial number (linux)
|
|
@@ -195,6 +197,10 @@ si.cpu()
|
|
|
195
197
|
|
|
196
198
|
You can find all changes here: [detailed changelog][changelog-url]
|
|
197
199
|
|
|
200
|
+
## Activity
|
|
201
|
+
|
|
202
|
+

|
|
203
|
+
|
|
198
204
|
## Core concept
|
|
199
205
|
|
|
200
206
|
[Node.js][nodejs-url] comes with some basic OS information, but I always wanted
|
|
@@ -1079,7 +1085,7 @@ Sebastian Hildebrandt, [+innovations](http://www.plus-innovations.com)
|
|
|
1079
1085
|
Written by Sebastian Hildebrandt
|
|
1080
1086
|
[sebhildebrandt](https://github.com/sebhildebrandt)
|
|
1081
1087
|
|
|
1082
|
-
|
|
1088
|
+
### Contributors
|
|
1083
1089
|
|
|
1084
1090
|
- Guillaume Legrain [glegrain](https://github.com/glegrain)
|
|
1085
1091
|
- Riccardo Novaglia [richy24](https://github.com/richy24)
|
|
@@ -1110,6 +1116,11 @@ OSX Temperature: credits here are going to:
|
|
|
1110
1116
|
- Frank Stock [pcafstockf](https://github.com/pcafstockf) - for his work on
|
|
1111
1117
|
[smc-code][smc-code-url]
|
|
1112
1118
|
|
|
1119
|
+
### Powered by
|
|
1120
|
+
|
|
1121
|
+
<a href="https://jb.gg/OpenSourceSupport"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg" alt="Alt Text" width="160"></a>
|
|
1122
|
+
<a href="https://plus-innovations.com"><img src="https://www.plus-innovations.com/wp-content/themes/bootstrap3/img/logo1000.png" alt="Alt Text" width="150" style="margin-bottom: 8px"></a>
|
|
1123
|
+
|
|
1113
1124
|
## Copyright Information
|
|
1114
1125
|
|
|
1115
1126
|
Linux is a registered trademark of Linus Torvalds. Apple, macOS, OS X are
|
package/lib/cpu.js
CHANGED
|
@@ -994,7 +994,7 @@ function getCpuCurrentSpeedSync() {
|
|
|
994
994
|
let cores = [];
|
|
995
995
|
let speeds = [];
|
|
996
996
|
|
|
997
|
-
if (cpus && cpus.length && cpus[0].speed) {
|
|
997
|
+
if (cpus && cpus.length && cpus[0].hasOwnProperty('speed')) {
|
|
998
998
|
for (let i in cpus) {
|
|
999
999
|
speeds.push(cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10);
|
|
1000
1000
|
}
|
|
@@ -1010,19 +1010,28 @@ function getCpuCurrentSpeedSync() {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
1012
|
if (speeds && speeds.length) {
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1013
|
+
try {
|
|
1014
|
+
for (let i in speeds) {
|
|
1015
|
+
avgFreq = avgFreq + speeds[i];
|
|
1016
|
+
if (speeds[i] > maxFreq) { maxFreq = speeds[i]; }
|
|
1017
|
+
if (speeds[i] < minFreq) { minFreq = speeds[i]; }
|
|
1018
|
+
cores.push(parseFloat(speeds[i].toFixed(2)));
|
|
1019
|
+
}
|
|
1020
|
+
avgFreq = avgFreq / speeds.length;
|
|
1021
|
+
return {
|
|
1022
|
+
min: parseFloat(minFreq.toFixed(2)),
|
|
1023
|
+
max: parseFloat(maxFreq.toFixed(2)),
|
|
1024
|
+
avg: parseFloat((avgFreq).toFixed(2)),
|
|
1025
|
+
cores: cores
|
|
1026
|
+
};
|
|
1027
|
+
} catch (e) {
|
|
1028
|
+
return {
|
|
1029
|
+
min: 0,
|
|
1030
|
+
max: 0,
|
|
1031
|
+
avg: 0,
|
|
1032
|
+
cores: cores
|
|
1033
|
+
};
|
|
1018
1034
|
}
|
|
1019
|
-
avgFreq = avgFreq / speeds.length;
|
|
1020
|
-
return {
|
|
1021
|
-
min: parseFloat(minFreq.toFixed(2)),
|
|
1022
|
-
max: parseFloat(maxFreq.toFixed(2)),
|
|
1023
|
-
avg: parseFloat((avgFreq).toFixed(2)),
|
|
1024
|
-
cores: cores
|
|
1025
|
-
};
|
|
1026
1035
|
} else {
|
|
1027
1036
|
return {
|
|
1028
1037
|
min: 0,
|
package/lib/graphics.js
CHANGED
|
@@ -425,7 +425,8 @@ function graphics(callback) {
|
|
|
425
425
|
options.stdio = ['pipe', 'pipe', 'ignore'];
|
|
426
426
|
}
|
|
427
427
|
try {
|
|
428
|
-
const
|
|
428
|
+
const sanitized = util.sanitizeShellString(cmd);
|
|
429
|
+
const res = execSync(sanitized, options).toString();
|
|
429
430
|
return res;
|
|
430
431
|
} catch (e) {
|
|
431
432
|
util.noop();
|
package/lib/index.d.ts
CHANGED
|
@@ -991,8 +991,11 @@ export function diskLayout(cb?: (data: Systeminformation.DiskLayoutData[]) => an
|
|
|
991
991
|
|
|
992
992
|
export function networkInterfaceDefault(cb?: (data: string) => any): Promise<string>;
|
|
993
993
|
export function networkGatewayDefault(cb?: (data: string) => any): Promise<string>;
|
|
994
|
+
export function networkInterfaces(): Promise<Systeminformation.NetworkInterfacesData[]>;
|
|
995
|
+
export function networkInterfaces(defaultString: 'default'): Promise<Systeminformation.NetworkInterfacesData>;
|
|
996
|
+
export function networkInterfaces(rescan: boolean): Promise<Systeminformation.NetworkInterfacesData[]>;
|
|
994
997
|
export function networkInterfaces(
|
|
995
|
-
cb
|
|
998
|
+
cb:
|
|
996
999
|
| ((data: Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData) => any)
|
|
997
1000
|
| boolean
|
|
998
1001
|
| string,
|
package/lib/index.js
CHANGED
|
@@ -95,7 +95,11 @@ function getStaticData(callback) {
|
|
|
95
95
|
graphics.graphics(),
|
|
96
96
|
network.networkInterfaces(),
|
|
97
97
|
memory.memLayout(),
|
|
98
|
-
filesystem.diskLayout()
|
|
98
|
+
filesystem.diskLayout(),
|
|
99
|
+
audio.audio(),
|
|
100
|
+
bluetooth.bluetoothDevices(),
|
|
101
|
+
usb.usb(),
|
|
102
|
+
printer.printer(),
|
|
99
103
|
]).then((res) => {
|
|
100
104
|
data.system = res[0];
|
|
101
105
|
data.bios = res[1];
|
|
@@ -110,6 +114,10 @@ function getStaticData(callback) {
|
|
|
110
114
|
data.net = res[10];
|
|
111
115
|
data.memLayout = res[11];
|
|
112
116
|
data.diskLayout = res[12];
|
|
117
|
+
data.audio = res[13];
|
|
118
|
+
data.bluetooth = res[14];
|
|
119
|
+
data.usb = res[15];
|
|
120
|
+
data.printer = res[16];
|
|
113
121
|
if (callback) { callback(data); }
|
|
114
122
|
resolve(data);
|
|
115
123
|
});
|
package/lib/util.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.26.1",
|
|
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)",
|