systeminformation 5.23.9 → 5.23.11

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/network.js CHANGED
@@ -1536,7 +1536,7 @@ function networkConnections(callback) {
1536
1536
  if (_darwin) {
1537
1537
  // let cmd = 'netstat -natv | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"';
1538
1538
  let cmd = 'netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
1539
- const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN';
1539
+ const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN';
1540
1540
  exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
1541
1541
  if (!error) {
1542
1542
  exec('ps -axo pid,command', { maxBuffer: 1024 * 20000 }, function (err2, stdout2) {
package/lib/osinfo.js CHANGED
@@ -34,12 +34,34 @@ const _sunos = (_platform === 'sunos');
34
34
 
35
35
  function time() {
36
36
  let t = new Date().toString().split(' ');
37
- return {
37
+ const result = {
38
38
  current: Date.now(),
39
39
  uptime: os.uptime(),
40
40
  timezone: (t.length >= 7) ? t[5] : '',
41
41
  timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
42
42
  };
43
+ if (_darwin || _linux) {
44
+ try {
45
+ const stdout = execSync('date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null', util.execOptsLinux);
46
+ const lines = stdout.toString().split(os.EOL);
47
+ if (lines.length > 3 && !lines[0]) {
48
+ lines.shift();
49
+ }
50
+ let timezone = lines[0] || '';
51
+ if (timezone.startsWith('+') || timezone.startsWith('-')) {
52
+ timezone = 'GMT';
53
+ }
54
+ return {
55
+ current: Date.now(),
56
+ uptime: os.uptime(),
57
+ timezone: lines[1] ? timezone + lines[1] : timezone,
58
+ timezoneName: lines[2] && lines[2].indexOf('/zoneinfo/') > 0 ? (lines[2].split('/zoneinfo/')[1] || '') : ''
59
+ };
60
+ } catch (e) {
61
+ util.noop();
62
+ }
63
+ }
64
+ return result;
43
65
  }
44
66
 
45
67
  exports.time = time;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.23.9",
3
+ "version": "5.23.11",
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)",