systeminformation 6.0.0-beta.3 → 6.0.0-beta.4

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.
@@ -63,7 +63,7 @@ const execSave = async (cmd, options = {}) => {
63
63
  return { stdout: stdout.toString(), stderr: stderr.toString() };
64
64
  }
65
65
  catch (e) {
66
- return { stdout: e.stdout, stderr: e.stderr };
66
+ return { stdout: String(e.stdout ?? ''), stderr: String(e.stderr ?? '') };
67
67
  }
68
68
  };
69
69
  exports.execSave = execSave;
@@ -114,7 +114,7 @@ const processLoad = async (proc) => {
114
114
  cmd += ';cat /proc/' + result[i].pids[j] + '/stat';
115
115
  }
116
116
  }
117
- ({ stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux));
117
+ ({ stdout } = await (0, exec_1.execSave)(cmd, const_1.execOptsLinux));
118
118
  let curr_processes = stdout.toString().split('\n');
119
119
  const all = (0, parse_1.parseProcStat)(curr_processes[0]);
120
120
  curr_processes = curr_processes.slice(1);
@@ -281,7 +281,7 @@ const processes = async () => {
281
281
  }
282
282
  ({ stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux));
283
283
  if (stdout.trim()) {
284
- const lines = stdout.trim().split('\n');
284
+ const lines = stdout.split('\n');
285
285
  const parsedhead = (0, parse_1.parseHead)(lines[0], 8);
286
286
  result.list = (await parseProcesses(lines, parsedhead)).slice();
287
287
  result.all = result.list.length;
@@ -293,7 +293,7 @@ const processes = async () => {
293
293
  result.list.forEach((element) => {
294
294
  cmd += ';cat /proc/' + element.pid + '/stat';
295
295
  });
296
- ({ stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux));
296
+ ({ stdout } = await (0, exec_1.execSave)(cmd, const_1.execOptsLinux));
297
297
  let curr_processes = stdout.toString().split('\n');
298
298
  const all = (0, parse_1.parseProcStat)(curr_processes[0]);
299
299
  curr_processes = curr_processes.slice(1);
@@ -89,7 +89,7 @@ const calcServicesCpuLinux = async (result) => {
89
89
  cmd += ';cat /proc/' + result[i].pids[j] + '/stat';
90
90
  }
91
91
  }
92
- const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
92
+ const { stdout } = await (0, exec_1.execSave)(cmd, const_1.execOptsLinux);
93
93
  let curr_processes = stdout.toString().split('\n');
94
94
  const all = (0, parse_1.parseProcStat)(curr_processes[0]);
95
95
  curr_processes = curr_processes.slice(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "6.0.0-beta.3",
3
+ "version": "6.0.0-beta.4",
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)",