systeminformation 5.27.5 → 5.27.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/README.md CHANGED
@@ -30,8 +30,8 @@
30
30
 
31
31
  ## The Systeminformation Project
32
32
 
33
- This is amazing. Started as a small project just for myself, it now has > 17,000
34
- lines of code, > 650 versions published, up to 8 mio downloads per month, > 350
33
+ This is amazing. Started as a small project just for myself, it now has > 18,000
34
+ lines of code, > 700 versions published, up to 9 mio downloads per month, > 380
35
35
  mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all
36
36
  who contributed to this project!
37
37
 
package/lib/osinfo.js CHANGED
@@ -34,11 +34,17 @@ const _sunos = (_platform === 'sunos');
34
34
 
35
35
  function time() {
36
36
  let t = new Date().toString().split(' ');
37
+ let timezoneName = '';
38
+ try {
39
+ timezoneName = Intl.DateTimeFormat().resolvedOptions().timeZone;
40
+ } catch {
41
+ timezoneName = (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : '';
42
+ }
37
43
  const result = {
38
44
  current: Date.now(),
39
45
  uptime: os.uptime(),
40
46
  timezone: (t.length >= 7) ? t[5] : '',
41
- timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
47
+ timezoneName
42
48
  };
43
49
  if (_darwin || _linux) {
44
50
  try {
package/lib/system.js CHANGED
@@ -16,6 +16,7 @@
16
16
  const fs = require('fs');
17
17
  const os = require('os');
18
18
  const util = require('./util');
19
+ const { uuid } = require('./osinfo');
19
20
  const exec = require('child_process').exec;
20
21
  const execSync = require('child_process').execSync;
21
22
  const execPromise = util.promisify(require('child_process').exec);
@@ -120,13 +121,18 @@ function system(callback) {
120
121
  util.noop();
121
122
  }
122
123
  }
123
- if (!result.uuid && (_freebsd || _openbsd || _netbsd)) {
124
+ if (_freebsd || _openbsd || _netbsd) {
124
125
  try {
125
- const lines = execSync('sysctl -i kern.hostuuid kern.hostid', util.execOptsLinux).toString().split('\n');
126
- result.uuid = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();
126
+ const lines = execSync('sysctl -i kern.hostuuid kern.hostid hw.model', util.execOptsLinux).toString().split('\n');
127
+ if (!result.uuid) {
128
+ result.uuid = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();
129
+ }
127
130
  if (!result.serial || result.serial === '-') {
128
131
  result.serial = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
129
132
  }
133
+ if (!result.model || result.model === 'Computer') {
134
+ result.model = util.getValue(lines, 'hw.model', ':').trim();
135
+ }
130
136
  } catch (e) {
131
137
  util.noop();
132
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.27.5",
3
+ "version": "5.27.7",
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)",