systeminformation 5.9.2 → 5.9.6

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/CHANGELOG.md CHANGED
@@ -47,10 +47,13 @@ We had to make **several interface changes** to keep systeminformation as consis
47
47
  - `cpu()`: added virtualization if cpu supports virtualization
48
48
  - `cpu()`: now flags are part of this function
49
49
  - `cpuTemperature()` added added socket and chipset temp (linux)
50
+ - `disksIO()` added wait time (linux)
50
51
  - `diskLayout()`: added USB drives (mac OS)
52
+ - `diskLayout()`: added S.M.R.R.T. (win)
51
53
  - `fsSize()`: added available
52
54
  - `fsSize()`: improved calculation of used
53
55
  - `getData()`: support for passing parameters and filters (see section General / getData)
56
+ - `graphics()`: extended properties (mac OS)
54
57
  - `graphics()`: extended nvidia-smi parsing
55
58
  - `networkInterfaces()`: type detection improved (win - wireless)
56
59
  - `memLayout()`: extended manufacturer list (decoding)
@@ -73,10 +76,14 @@ If you want to see all function results on your machine, please head over to (Te
73
76
 
74
77
  For major (breaking) changes - **version 4, 3 and 2** - see end of page.
75
78
 
76
- ## Version history
79
+ ## Version History
77
80
 
78
81
  | Version | Date | Comment |
79
82
  | -------------- | -------------- | -------- |
83
+ | 5.9.6 | 2021-10-08 | `system()` fixed virtual on WSL2 |
84
+ | 5.9.5 | 2021-10-08 | `battery()` fixed isCharging (windows) |
85
+ | 5.9.4 | 2021-09-23 | `processes()` fixed memVsz, Memrss (macOS M1) |
86
+ | 5.9.3 | 2021-09-17 | `cpuTemperature()` improved tdie detection (linus) |
80
87
  | 5.9.2 | 2021-09-16 | `graohics()` (macOS), `memLayout()` (win) improvements |
81
88
  | 5.9.1 | 2021-09-15 | `diskLayout()` fix size (macOS) |
82
89
  | 5.9.0 | 2021-09-15 | `graphics()` new XML parser, added properties (macOS) |
package/README.md CHANGED
@@ -30,7 +30,7 @@
30
30
  [![Sponsoring][sponsor-badge]][sponsor-url]
31
31
  [![MIT license][license-img]][license-url]
32
32
 
33
- This is amazing. Started as a small project just for myself, it now has > 10,000 lines of code, > 400 versions published, up to 3 mio downloads per month, > 45 mio downloads overall. Thank you to all who contributed to this project!
33
+ This is amazing. Started as a small project just for myself, it now has > 10,000 lines of code, > 450 versions published, up to 4 mio downloads per month, > 50 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
34
34
 
35
35
  ## New Version 5.0
36
36
 
package/lib/battery.js CHANGED
@@ -52,7 +52,7 @@ function parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) {
52
52
  result.percent = parseInt(util.getValue(lines, 'EstimatedChargeRemaining', '=') || 0);
53
53
  result.currentCapacity = parseInt(result.maxCapacity * result.percent / 100);
54
54
  result.isCharging = (statusValue >= 6 && statusValue <= 9) || statusValue === 11 || (!(statusValue === 3) && !(statusValue === 1) && result.percent < 100);
55
- result.acConnected = result.ischarging || statusValue === 2;
55
+ result.acConnected = result.isCharging || statusValue === 2;
56
56
  result.model = util.getValue(lines, 'DeviceID', '=');
57
57
  } else {
58
58
  result.status = -1;
package/lib/cpu.js CHANGED
@@ -967,7 +967,12 @@ function cpuTemperature(callback) {
967
967
  const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=$(echo $label | rev | cut -c 7- | rev)_input; if [ -f "$value" ]; then echo $(cat "$label")___$(cat "$value"); fi; fi; done; done;';
968
968
  try {
969
969
  exec(cmd, function (error, stdout) {
970
- let lines = stdout.toString().split('\n');
970
+ stdout = stdout.toString();
971
+ const tdiePos = stdout.toLowerCase().indexOf('tdie');
972
+ if (tdiePos !== -1) {
973
+ stdout = stdout.substring(tdiePos);
974
+ }
975
+ let lines = stdout.split('\n');
971
976
  lines.forEach(line => {
972
977
  const parts = line.split('___');
973
978
  const label = parts[0];
package/lib/processes.js CHANGED
@@ -686,7 +686,7 @@ function processes(callback) {
686
686
  if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) {
687
687
  if (_linux) { cmd = 'export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,lstart:30,state:5,tty:15,user:20,command; unset LC_ALL'; }
688
688
  if (_freebsd || _openbsd || _netbsd) { cmd = 'export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,lstart,state,tty,user,command; unset LC_ALL'; }
689
- if (_darwin) { cmd = 'export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,nice,lstart,state,tty,user,command -r; unset LC_ALL'; }
689
+ if (_darwin) { cmd = 'ps -axo pid,ppid,pcpu,pmem,pri,vsz=xxx_fake_title,rss=fake_title2,nice,lstart,state,tty,user,command -r'; }
690
690
  if (_sunos) { cmd = 'ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm'; }
691
691
  exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
692
692
  if (!error && stdout.toString().trim()) {
package/lib/system.js CHANGED
@@ -122,10 +122,10 @@ function system(callback) {
122
122
  util.noop();
123
123
  }
124
124
  }
125
- if (!result.virtual && util.linuxVersion().toLowerCase().indexOf('microsoft') >= 0) {
125
+ if (!result.virtual && (util.linuxVersion().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {
126
126
  let versionStr = util.linuxVersion().toLowerCase();
127
127
  versionStr = versionStr.split('-')[0].replace('#', '');
128
- const version = parseInt(versionStr, 10) || null;
128
+ const version = os.release().toLowerCase().endsWith('wsl2') ? 'WSL2' : parseInt(versionStr, 10) || null;
129
129
  result.virtual = true;
130
130
  result.manufacturer = 'Microsoft';
131
131
  result.model = 'WSL';
package/lib/users.js CHANGED
@@ -283,7 +283,7 @@ function users(callback) {
283
283
  }
284
284
  if (_windows) {
285
285
  try {
286
- exec('query user', util.execOptsWin, function (error, stdout) {
286
+ util.execWin('query user', util.execOptsWin, function (error, stdout) {
287
287
  if (stdout) {
288
288
  // lines / split
289
289
  let lines = stdout.toString().split('\r\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.9.2",
4
- "description": "Simple system and OS information library",
3
+ "version": "5.9.6",
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)",
7
7
  "homepage": "https://systeminformation.io",
@@ -70,7 +70,10 @@
70
70
  "virtual box",
71
71
  "virtualbox",
72
72
  "vm",
73
- "backend"
73
+ "backend",
74
+ "hardware",
75
+ "BIOS",
76
+ "chassis"
74
77
  ],
75
78
  "repository": {
76
79
  "type": "git",