systeminformation 5.9.5 → 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
@@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
80
80
 
81
81
  | Version | Date | Comment |
82
82
  | -------------- | -------------- | -------- |
83
+ | 5.9.6 | 2021-10-08 | `system()` fixed virtual on WSL2 |
83
84
  | 5.9.5 | 2021-10-08 | `battery()` fixed isCharging (windows) |
84
85
  | 5.9.4 | 2021-09-23 | `processes()` fixed memVsz, Memrss (macOS M1) |
85
86
  | 5.9.3 | 2021-09-17 | `cpuTemperature()` improved tdie detection (linus) |
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.9.5",
3
+ "version": "5.9.6",
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)",