systeminformation 5.9.3 → 5.9.7

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
@@ -76,10 +76,14 @@ If you want to see all function results on your machine, please head over to (Te
76
76
 
77
77
  For major (breaking) changes - **version 4, 3 and 2** - see end of page.
78
78
 
79
- ## Version history
79
+ ## Version History
80
80
 
81
81
  | Version | Date | Comment |
82
82
  | -------------- | -------------- | -------- |
83
+ | 5.9.7 | 2021-10-09 | `battery()` fixed typo seperator (windows) |
84
+ | 5.9.6 | 2021-10-08 | `system()` fixed virtual on WSL2 |
85
+ | 5.9.5 | 2021-10-08 | `battery()` fixed isCharging (windows) |
86
+ | 5.9.4 | 2021-09-23 | `processes()` fixed memVsz, Memrss (macOS M1) |
83
87
  | 5.9.3 | 2021-09-17 | `cpuTemperature()` improved tdie detection (linus) |
84
88
  | 5.9.2 | 2021-09-16 | `graohics()` (macOS), `memLayout()` (win) improvements |
85
89
  | 5.9.1 | 2021-09-15 | `diskLayout()` fix size (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;
@@ -120,7 +120,7 @@ module.exports = function (callback) {
120
120
  result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_NOW', '='), 10) / 1000.0 * (result.voltage || 1));
121
121
  if (!result.maxCapacity) {
122
122
  result.maxCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL', '=', true, true), 10) / 1000.0;
123
- result.designedCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL_DESIGN', true, true, '='), 10) / 1000.0 | result.maxCapacity;
123
+ result.designedCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL_DESIGN', '=', true, true), 10) / 1000.0 | result.maxCapacity;
124
124
  result.currentCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10) / 1000.0;
125
125
  }
126
126
  const percent = util.getValue(lines, 'POWER_SUPPLY_CAPACITY', '=');
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.3",
4
- "description": "Simple system and OS information library",
3
+ "version": "5.9.7",
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",