systeminformation 5.11.3 → 5.11.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/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 > 15,000 lines of code, > 500 versions published, up to 4 mio downloads per month, > 60 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
33
+ This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 4 mio downloads per month, > 75 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
 
@@ -1003,7 +1003,8 @@ NetBSD is a registered trademark of The NetBSD Foundation, Docker is a trademark
1003
1003
  Solaris, OpenSolaris and registered trademarks of Sun Microsystems, VMware is a trademark of VMware Inc,
1004
1004
  Virtual Box is a trademark of Oracle Corporation, Xen is a registered trademark of Xen Project,
1005
1005
  QEMU is a trademark of Fabrice Bellard, bochs is a trademark of The Bochs Project, USB and USB Logo
1006
- are trademarks of USB Implementation Forum, Bluetooth and Bluetooth Logo are trademarks of Bluetooth SIG.
1006
+ are trademarks of USB Implementation Forum, Bluetooth and Bluetooth Logo are trademarks of Bluetooth SIG,
1007
+ Android is a trademark of Google LLC.
1007
1008
 
1008
1009
  All other trademarks are the property of their respective owners.
1009
1010
 
package/lib/filesystem.js CHANGED
@@ -1239,20 +1239,26 @@ function diskLayout(callback) {
1239
1239
  // S.M.A.R.T
1240
1240
  data.results.shift();
1241
1241
  data.results.shift();
1242
- data.results.forEach((smartStr) => {
1243
- const smartData = JSON.parse(smartStr);
1244
- if (smartData.serial_number) {
1245
- const serialNum = smartData.serial_number;
1246
- let i = util.findObjectByKey(result, 'serialNum', serialNum);
1247
- if (i != -1) {
1248
- result[i].smartStatus = (smartData.smart_status.passed ? 'Ok' : (smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));
1249
- if (smartData.temperature && smartData.temperature.current) {
1250
- result[i].temperature = smartData.temperature.current;
1242
+ if (data.results.length) {
1243
+ data.results.forEach((smartStr) => {
1244
+ try {
1245
+ const smartData = JSON.parse(smartStr);
1246
+ if (smartData.serial_number) {
1247
+ const serialNum = smartData.serial_number;
1248
+ let i = util.findObjectByKey(result, 'serialNum', serialNum);
1249
+ if (i != -1) {
1250
+ result[i].smartStatus = (smartData.smart_status.passed ? 'Ok' : (smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));
1251
+ if (smartData.temperature && smartData.temperature.current) {
1252
+ result[i].temperature = smartData.temperature.current;
1253
+ }
1254
+ result[i].smartData = smartData;
1255
+ }
1251
1256
  }
1252
- result[i].smartData = smartData;
1257
+ } catch (e) {
1258
+ util.noop();
1253
1259
  }
1254
- }
1255
- });
1260
+ });
1261
+ }
1256
1262
  if (callback) {
1257
1263
  callback(result);
1258
1264
  }
package/lib/index.d.ts CHANGED
@@ -269,6 +269,7 @@ export namespace Systeminformation {
269
269
  serialNum: string;
270
270
  interfaceType: string;
271
271
  smartStatus: string;
272
+ temperature: null | number;
272
273
  smartData?: SmartData;
273
274
  }
274
275
 
package/lib/network.js CHANGED
@@ -254,8 +254,8 @@ function getWindowsNics() {
254
254
  try {
255
255
  util.powerShell(cmd).then(data => {
256
256
  data = data.split('#-#-#-#');
257
- const nsections = data[0].split(/\n\s*\n/);
258
- const nconfigsections = data[1].split(/\n\s*\n/);
257
+ const nsections = (data[0] || '').split(/\n\s*\n/);
258
+ const nconfigsections = (data[1] || '').split(/\n\s*\n/);
259
259
  resolve(parseLinesWindowsNics(nsections, nconfigsections));
260
260
  });
261
261
  } catch (e) {
package/lib/users.js CHANGED
@@ -262,10 +262,10 @@ function users(callback) {
262
262
  // let accounts = parseWinAccounts(data[0].split(/\n\s*\n/));
263
263
  if (data) {
264
264
  data = data.split('#-#-#-#');
265
- let sessions = parseWinSessions(data[0].split(/\n\s*\n/));
266
- let loggedons = parseWinLoggedOn(data[1].split(/\n\s*\n/));
267
- let queryUser = parseWinUsersQuery(data[3].split('\r\n'));
268
- let users = parseWinUsers(data[2].split(/\n\s*\n/), queryUser);
265
+ let sessions = parseWinSessions((data[0] || '').split(/\n\s*\n/));
266
+ let loggedons = parseWinLoggedOn((data[1] || '').split(/\n\s*\n/));
267
+ let queryUser = parseWinUsersQuery((data[3] || '').split('\r\n'));
268
+ let users = parseWinUsers((data[2] || '').split(/\n\s*\n/), queryUser);
269
269
  for (let id in loggedons) {
270
270
  if ({}.hasOwnProperty.call(loggedons, id)) {
271
271
  loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
package/lib/util.js CHANGED
@@ -396,7 +396,7 @@ function powerShellProceedResults(data) {
396
396
  }
397
397
 
398
398
  function powerShellStart() {
399
- _psChild = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {
399
+ _psChild = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-Command', '-'], {
400
400
  stdio: 'pipe',
401
401
  windowsHide: true,
402
402
  maxBuffer: 1024 * 20000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.11.3",
3
+ "version": "5.11.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)",