systeminformation 5.13.3 → 5.13.5

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/lib/audio.js CHANGED
@@ -31,6 +31,7 @@ function parseAudioType(str, input, output) {
31
31
  str = str.toLowerCase();
32
32
  let result = '';
33
33
 
34
+ if (str.indexOf('input') >= 0) { result = 'Microphone'; }
34
35
  if (str.indexOf('display audio') >= 0) { result = 'Speaker'; }
35
36
  if (str.indexOf('speak') >= 0) { result = 'Speaker'; }
36
37
  if (str.indexOf('laut') >= 0) { result = 'Speaker'; }
@@ -42,6 +43,8 @@ function parseAudioType(str, input, output) {
42
43
  if (str.indexOf('controll') >= 0) { result = 'Controller'; }
43
44
  if (str.indexOf('line o') >= 0) { result = 'Line Out'; }
44
45
  if (str.indexOf('digital o') >= 0) { result = 'Digital Out'; }
46
+ if (str.indexOf('smart sound technology') >= 0) { result = 'Digital Signal Processor'; }
47
+ if (str.indexOf('high definition audio') >= 0) { result = 'Sound Driver'; }
45
48
 
46
49
  if (!result && output) {
47
50
  result = 'Speaker';
package/lib/processes.js CHANGED
@@ -69,16 +69,6 @@ const _winStatusValues = {
69
69
  '9': 'growing',
70
70
  };
71
71
 
72
-
73
- function parseTimeWin(time) {
74
- time = time || '';
75
- if (time) {
76
- return (time.substr(0, 4) + '-' + time.substr(4, 2) + '-' + time.substr(6, 2) + ' ' + time.substr(8, 2) + ':' + time.substr(10, 2) + ':' + time.substr(12, 2));
77
- } else {
78
- return '';
79
- }
80
- }
81
-
82
72
  function parseTimeUnix(time) {
83
73
  let result = time;
84
74
  let parts = time.replace(/ +/g, ' ').split(' ');
@@ -823,7 +813,7 @@ function processes(callback) {
823
813
  });
824
814
  } else if (_windows) {
825
815
  try {
826
- util.powerShell('Get-CimInstance Win32_Process | select ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,CreationDate | fl').then((stdout, error) => {
816
+ util.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then((stdout, error) => {
827
817
  if (!error) {
828
818
  let processSections = stdout.split(/\n\s*\n/);
829
819
  let procs = [];
@@ -882,7 +872,7 @@ function processes(callback) {
882
872
  memVsz: parseInt(util.getValue(lines, 'PageFileUsage', ':', true), 10),
883
873
  memRss: Math.floor(parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10) / 1024),
884
874
  nice: 0,
885
- started: parseTimeWin(util.getValue(lines, 'CreationDate', ':', true)),
875
+ started: util.getValue(lines, 'CreationDate', ':', true),
886
876
  state: (!statusValue ? _winStatusValues[0] : _winStatusValues[statusValue]),
887
877
  tty: '',
888
878
  user: '',
package/lib/system.js CHANGED
@@ -506,7 +506,7 @@ function bios(callback) {
506
506
  }
507
507
  if (_windows) {
508
508
  try {
509
- util.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,ReleaseDate,BuildNumber,SerialNumber | fl').then((stdout, error) => {
509
+ util.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber | fl').then((stdout, error) => {
510
510
  if (!error) {
511
511
  let lines = stdout.toString().split('\r\n');
512
512
  const description = util.getValue(lines, 'description', ':');
@@ -523,9 +523,6 @@ function bios(callback) {
523
523
  result.version = util.getValue(lines, 'version', ':');
524
524
  }
525
525
  result.releaseDate = util.getValue(lines, 'releasedate', ':');
526
- if (result.releaseDate.length >= 10) {
527
- result.releaseDate = result.releaseDate.substr(0, 4) + '-' + result.releaseDate.substr(4, 2) + '-' + result.releaseDate.substr(6, 2);
528
- }
529
526
  result.revision = util.getValue(lines, 'buildnumber', ':');
530
527
  result.serial = util.getValue(lines, 'serialnumber', ':');
531
528
  }
package/lib/users.js CHANGED
@@ -207,9 +207,10 @@ function users(callback) {
207
207
  }
208
208
  if (_windows) {
209
209
  try {
210
- let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,StartTime | fl' + '; echo \'#-#-#-#\';';
210
+ let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl' + '; echo \'#-#-#-#\';';
211
211
  cmd += 'Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \'#-#-#-#\';';
212
- cmd += 'Get-CimInstance Win32_Process -Filter "name=\'explorer.exe\'" | Select @{Name="sessionid";Expression={$_.SessionId}}, @{Name="domain";Expression={$_.GetOwner().Domain}}, @{Name="username";Expression={$_.GetOwner().User}} | fl' + '; echo \'#-#-#-#\';';
212
+ // cmd += `Get-CimInstance Win32_Process -Filter 'name="explorer.exe"' | Select @{Name="sessionid";Expression={$_.SessionId}}, @{Name="domain";Expression={$_.GetOwner().Domain}}, @{Name="username";Expression={$_.GetOwner().User}} | fl` + '; echo \'#-#-#-#\';';
213
+ cmd += '$process = (Get-CimInstance Win32_Process -Filter "name = \'explorer.exe\'"); Invoke-CimMethod -InputObject $process -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo \'#-#-#-#\';';
213
214
  cmd += 'query user';
214
215
  util.powerShell(cmd).then((data) => {
215
216
  if (data) {
@@ -236,8 +237,8 @@ function users(callback) {
236
237
  result.push({
237
238
  user: user.user,
238
239
  tty: user.tty,
239
- date: `${dateTime.substr(0, 4)}-${dateTime.substr(4, 2)}-${dateTime.substr(6, 2)}`,
240
- time: `${dateTime.substr(8, 2)}:${dateTime.substr(10, 2)}`,
240
+ date: `${dateTime.substring(0, 10)}`,
241
+ time: `${dateTime.substring(11, 19)}`,
241
242
  ip: '',
242
243
  command: ''
243
244
  });
@@ -247,27 +248,11 @@ function users(callback) {
247
248
  resolve(result);
248
249
 
249
250
  });
250
- // util.powerShell('query user').then(stdout => {
251
- // if (stdout) {
252
- // // lines / split
253
- // let lines = stdout.toString().split('\r\n');
254
- // getWinCulture()
255
- // .then(culture => {
256
- // result = parseUsersWin(lines, culture);
257
- // if (callback) { callback(result); }
258
- // resolve(result);
259
- // });
260
- // } else {
261
- // if (callback) { callback(result); }
262
- // resolve(result);
263
- // }
264
- // });
265
251
  } catch (e) {
266
252
  if (callback) { callback(result); }
267
253
  resolve(result);
268
254
  }
269
255
  }
270
-
271
256
  });
272
257
  });
273
258
  }
@@ -317,7 +302,7 @@ function parseWinUsers(userParts, userQuery) {
317
302
  const lines = user.split('\r\n');
318
303
 
319
304
  const domain = util.getValue(lines, 'domain', ':', true);
320
- const username = util.getValue(lines, 'username', ':', true);
305
+ const username = util.getValue(lines, 'user', ':', true);
321
306
  const sessionid = util.getValue(lines, 'sessionid', ':', true);
322
307
 
323
308
  if (username) {
@@ -338,14 +323,12 @@ function parseWinLoggedOn(loggedonParts) {
338
323
  const lines = loggedon.split('\r\n');
339
324
 
340
325
  const antecendent = util.getValue(lines, 'antecedent', ':', true);
341
- let parts = antecendent.split(',');
342
- const domainParts = parts.length > 1 ? parts[0].split('=') : [];
343
- const nameParts = parts.length > 1 ? parts[1].split('=') : [];
344
- const domain = domainParts.length > 1 ? domainParts[1].replace(/"/g, '') : '';
345
- const name = nameParts.length > 1 ? nameParts[1].replace(/"/g, '') : '';
326
+ let parts = antecendent.split('=');
327
+ const name = parts.length > 2 ? parts[1].split(',')[0].replace(/"/g, '').trim() : '';
328
+ const domain = parts.length > 2 ? parts[2].replace(/"/g, '').trim() : '';
346
329
  const dependent = util.getValue(lines, 'dependent', ':', true);
347
330
  parts = dependent.split('=');
348
- const id = parts.length > 1 ? parts[1].replace(/"/g, '') : '';
331
+ const id = parts.length > 1 ? parts[1].replace(/"/g, '').replace(/\)/g, '').trim() : '';
349
332
  if (id) {
350
333
  loggedons[id] = {
351
334
  domain,
package/lib/util.js CHANGED
@@ -564,7 +564,7 @@ function getCodepage() {
564
564
  const stdout = execSync('chcp', execOptsWin);
565
565
  const lines = stdout.toString().split('\r\n');
566
566
  const parts = lines[0].split(':');
567
- codepage = parts.length > 1 ? parts[1].replace('.', '') : '';
567
+ codepage = parts.length > 1 ? parts[1].replace('.', '').trim() : '';
568
568
  } catch (err) {
569
569
  codepage = '437';
570
570
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.13.3",
3
+ "version": "5.13.5",
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)",