systeminformation 5.18.13 → 5.18.15
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 +21 -4
- package/lib/cli.js +66 -6
- package/lib/filesystem.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,11 +31,15 @@
|
|
|
31
31
|
## The Systeminformation Project
|
|
32
32
|
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 6 mio downloads per month, > 150 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Please support this project ... ☕️
|
|
35
|
+
|
|
36
|
+
Over the past few years I spent **over 2.000 hours** working on this project and invested in hardware to be able to test on different platforms. Currently I am working very hard on the next **new version 6.0** completely rewritten in TypeScript and with a lot of new features. Any support is highly appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo).
|
|
37
|
+
|
|
38
|
+
**Your contribution** make it possible for me to keep working on this project, add new features and support more platforms. Thank you in advance!
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
## New Version 5.0
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
The new Version 5 is here - this next major version release 5.0 comes with new functionality and several improvements and changes (some of them are breaking changes!):
|
|
39
43
|
|
|
40
44
|
- added audio: get detailed audio device information
|
|
41
45
|
- added bluetooth: get detailed bluetooth device information
|
|
@@ -75,9 +79,22 @@ npm install systeminformation --save
|
|
|
75
79
|
or simpler
|
|
76
80
|
|
|
77
81
|
```bash
|
|
78
|
-
npm
|
|
82
|
+
npm i systeminformation
|
|
79
83
|
```
|
|
80
84
|
|
|
85
|
+
### Give it a try with `npx`?
|
|
86
|
+
|
|
87
|
+
You just want to give it a try - right from your command line without installing it? Here is how you can call it with `npx`:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
# get basic system info (System, OS, CPU)
|
|
91
|
+
npx systeminformation info
|
|
92
|
+
|
|
93
|
+
# obtain all static data - may take up to 30 seconds
|
|
94
|
+
npx systeminformation
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
|
|
81
98
|
#### Still need Version 4?
|
|
82
99
|
|
|
83
100
|
If you need version 4 (for compatibility reasons), you can install version 4 (latest release) like this
|
package/lib/cli.js
CHANGED
|
@@ -17,15 +17,75 @@
|
|
|
17
17
|
// Dependencies
|
|
18
18
|
// ----------------------------------------------------------------------------------
|
|
19
19
|
const si = require('./index');
|
|
20
|
+
const lib_version = require('../package.json').version;
|
|
21
|
+
|
|
22
|
+
function capFirst(string) {
|
|
23
|
+
return string[0].toUpperCase() + string.slice(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function printLines(obj) {
|
|
27
|
+
for (const property in obj) {
|
|
28
|
+
console.log(capFirst(property) + ' '.substring(0, 17 - property.length) + ': ' + (obj[property] || ''));
|
|
29
|
+
}
|
|
30
|
+
console.log();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function info() {
|
|
34
|
+
console.log('┌─────────────────────────────────────────────────────────────────────────────────────────┐');
|
|
35
|
+
console.log('│ SYSTEMINFORMATION '.substring(0, 80 - lib_version.length) + 'Version: ' + lib_version + ' │');
|
|
36
|
+
console.log('└─────────────────────────────────────────────────────────────────────────────────────────┘');
|
|
37
|
+
|
|
38
|
+
si.osInfo().then(res => {
|
|
39
|
+
console.log();
|
|
40
|
+
console.log('Operating System:');
|
|
41
|
+
console.log('──────────────────────────────────────────────────────────────────────────────────────────');
|
|
42
|
+
delete res.serial;
|
|
43
|
+
delete res.servicepack;
|
|
44
|
+
delete res.logofile;
|
|
45
|
+
delete res.fqdn;
|
|
46
|
+
delete res.uefi;
|
|
47
|
+
printLines(res);
|
|
48
|
+
si.system().then(res => {
|
|
49
|
+
console.log('System:');
|
|
50
|
+
console.log('──────────────────────────────────────────────────────────────────────────────────────────');
|
|
51
|
+
delete res.serial;
|
|
52
|
+
delete res.uuid;
|
|
53
|
+
delete res.sku;
|
|
54
|
+
delete res.uuid;
|
|
55
|
+
printLines(res);
|
|
56
|
+
si.cpu().then(res => {
|
|
57
|
+
console.log('CPU:');
|
|
58
|
+
console.log('──────────────────────────────────────────────────────────────────────────────────────────');
|
|
59
|
+
delete res.cache;
|
|
60
|
+
delete res.governor;
|
|
61
|
+
delete res.flags;
|
|
62
|
+
delete res.virtualization;
|
|
63
|
+
delete res.revision;
|
|
64
|
+
delete res.voltage;
|
|
65
|
+
delete res.vendor;
|
|
66
|
+
delete res.speedMin;
|
|
67
|
+
delete res.speedMax;
|
|
68
|
+
printLines(res);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
20
73
|
|
|
21
74
|
// ----------------------------------------------------------------------------------
|
|
22
75
|
// Main
|
|
23
76
|
// ----------------------------------------------------------------------------------
|
|
24
77
|
(function () {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
78
|
+
const args = process.argv.slice(2);
|
|
79
|
+
|
|
80
|
+
if (args[0] === 'info') {
|
|
81
|
+
info();
|
|
82
|
+
} else {
|
|
83
|
+
si.getStaticData().then(
|
|
84
|
+
((data) => {
|
|
85
|
+
data.time = si.time();
|
|
86
|
+
console.log(JSON.stringify(data, null, 2));
|
|
87
|
+
}
|
|
88
|
+
));
|
|
89
|
+
}
|
|
90
|
+
|
|
31
91
|
})();
|
package/lib/filesystem.js
CHANGED
|
@@ -142,7 +142,7 @@ function fsSize(drive, callback) {
|
|
|
142
142
|
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
|
|
143
143
|
return line.startsWith('/');
|
|
144
144
|
}).forEach((line) => {
|
|
145
|
-
osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]]
|
|
145
|
+
osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]] || false;
|
|
146
146
|
if (line.toLowerCase().indexOf('/snap/') === -1) {
|
|
147
147
|
osMounts[line.split(' ')[0]] = ((line.toLowerCase().indexOf('rw,') >= 0 || line.toLowerCase().indexOf(' rw ') >= 0));
|
|
148
148
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.15",
|
|
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)",
|