systeminformation 5.30.3 → 5.30.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/memory.js +23 -23
- package/lib/network.js +28 -35
- package/lib/printer.js +4 -4
- package/lib/users.js +1 -1
- package/lib/util.js +1 -1
- package/lib/virtualbox.js +4 -4
- package/lib/wifi.js +9 -9
- package/package.json +1 -1
package/lib/memory.js
CHANGED
|
@@ -161,7 +161,7 @@ function mem(callback) {
|
|
|
161
161
|
|
|
162
162
|
if (_linux) {
|
|
163
163
|
try {
|
|
164
|
-
fs.readFile('/proc/meminfo',
|
|
164
|
+
fs.readFile('/proc/meminfo', (error, stdout) => {
|
|
165
165
|
if (!error) {
|
|
166
166
|
const lines = stdout.toString().split('\n');
|
|
167
167
|
result.total = parseInt(util.getValue(lines, 'memtotal'), 10);
|
|
@@ -199,7 +199,7 @@ function mem(callback) {
|
|
|
199
199
|
}
|
|
200
200
|
resolve(result);
|
|
201
201
|
});
|
|
202
|
-
} catch
|
|
202
|
+
} catch {
|
|
203
203
|
if (callback) {
|
|
204
204
|
callback(result);
|
|
205
205
|
}
|
|
@@ -210,9 +210,9 @@ function mem(callback) {
|
|
|
210
210
|
try {
|
|
211
211
|
exec(
|
|
212
212
|
'/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size',
|
|
213
|
-
|
|
213
|
+
(error, stdout) => {
|
|
214
214
|
if (!error) {
|
|
215
|
-
|
|
215
|
+
const lines = stdout.toString().split('\n');
|
|
216
216
|
const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);
|
|
217
217
|
const inactive = parseInt(util.getValue(lines, 'vm.stats.vm.v_inactive_count'), 10) * pagesize;
|
|
218
218
|
const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;
|
|
@@ -236,7 +236,7 @@ function mem(callback) {
|
|
|
236
236
|
resolve(result);
|
|
237
237
|
}
|
|
238
238
|
);
|
|
239
|
-
} catch
|
|
239
|
+
} catch {
|
|
240
240
|
if (callback) {
|
|
241
241
|
callback(result);
|
|
242
242
|
}
|
|
@@ -254,11 +254,11 @@ function mem(callback) {
|
|
|
254
254
|
try {
|
|
255
255
|
let sysPpageSize = util.toInt(execSync('sysctl -n vm.pagesize').toString());
|
|
256
256
|
pageSize = sysPpageSize || pageSize;
|
|
257
|
-
} catch
|
|
257
|
+
} catch {
|
|
258
258
|
util.noop();
|
|
259
259
|
}
|
|
260
260
|
try {
|
|
261
|
-
exec('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive"',
|
|
261
|
+
exec('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive"', (error, stdout) => {
|
|
262
262
|
if (!error) {
|
|
263
263
|
let lines = stdout.toString().split('\n');
|
|
264
264
|
result.active = (parseInt(util.getValue(lines, 'Pages active'), 10) || 0) * pageSize;
|
|
@@ -266,7 +266,7 @@ function mem(callback) {
|
|
|
266
266
|
result.buffcache = result.used - result.active;
|
|
267
267
|
result.available = result.free + result.buffcache;
|
|
268
268
|
}
|
|
269
|
-
exec('sysctl -n vm.swapusage 2>/dev/null',
|
|
269
|
+
exec('sysctl -n vm.swapusage 2>/dev/null', (error, stdout) => {
|
|
270
270
|
if (!error) {
|
|
271
271
|
let lines = stdout.toString().split('\n');
|
|
272
272
|
if (lines.length > 0) {
|
|
@@ -291,7 +291,7 @@ function mem(callback) {
|
|
|
291
291
|
resolve(result);
|
|
292
292
|
});
|
|
293
293
|
});
|
|
294
|
-
} catch
|
|
294
|
+
} catch {
|
|
295
295
|
if (callback) {
|
|
296
296
|
callback(result);
|
|
297
297
|
}
|
|
@@ -308,7 +308,7 @@ function mem(callback) {
|
|
|
308
308
|
.split('\r\n')
|
|
309
309
|
.filter((line) => line.trim() !== '')
|
|
310
310
|
.filter((line, idx) => idx > 0);
|
|
311
|
-
lines.forEach(
|
|
311
|
+
lines.forEach((line) => {
|
|
312
312
|
if (line !== '') {
|
|
313
313
|
line = line.trim().split(/\s\s+/);
|
|
314
314
|
swaptotal = swaptotal + (parseInt(line[0], 10) || 0);
|
|
@@ -325,7 +325,7 @@ function mem(callback) {
|
|
|
325
325
|
}
|
|
326
326
|
resolve(result);
|
|
327
327
|
});
|
|
328
|
-
} catch
|
|
328
|
+
} catch {
|
|
329
329
|
if (callback) {
|
|
330
330
|
callback(result);
|
|
331
331
|
}
|
|
@@ -354,12 +354,12 @@ function memLayout(callback) {
|
|
|
354
354
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
|
355
355
|
exec(
|
|
356
356
|
'export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',
|
|
357
|
-
|
|
357
|
+
(error, stdout) => {
|
|
358
358
|
if (!error) {
|
|
359
|
-
|
|
359
|
+
const devices = stdout.toString().split('Memory Device');
|
|
360
360
|
devices.shift();
|
|
361
|
-
devices.forEach(
|
|
362
|
-
|
|
361
|
+
devices.forEach((device) => {
|
|
362
|
+
const lines = device.split('\n');
|
|
363
363
|
const sizeString = util.getValue(lines, 'Size');
|
|
364
364
|
const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;
|
|
365
365
|
let bank = util.getValue(lines, 'Bank Locator');
|
|
@@ -457,7 +457,7 @@ function memLayout(callback) {
|
|
|
457
457
|
result[0].voltageMax = voltage;
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
} catch
|
|
460
|
+
} catch {
|
|
461
461
|
util.noop();
|
|
462
462
|
}
|
|
463
463
|
}
|
|
@@ -470,7 +470,7 @@ function memLayout(callback) {
|
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
if (_darwin) {
|
|
473
|
-
exec('system_profiler SPMemoryDataType',
|
|
473
|
+
exec('system_profiler SPMemoryDataType', (error, stdout) => {
|
|
474
474
|
if (!error) {
|
|
475
475
|
const allLines = stdout.toString().split('\n');
|
|
476
476
|
const eccStatus = util.getValue(allLines, 'ecc', ':', true).toLowerCase();
|
|
@@ -481,8 +481,8 @@ function memLayout(callback) {
|
|
|
481
481
|
hasBank = false;
|
|
482
482
|
}
|
|
483
483
|
devices.shift();
|
|
484
|
-
devices.forEach(
|
|
485
|
-
|
|
484
|
+
devices.forEach((device) => {
|
|
485
|
+
const lines = device.split('\n');
|
|
486
486
|
const bank = (hasBank ? 'BANK ' : 'DIMM') + lines[0].trim().split('/')[0];
|
|
487
487
|
const size = parseInt(util.getValue(lines, ' Size'));
|
|
488
488
|
if (size) {
|
|
@@ -567,10 +567,10 @@ function memLayout(callback) {
|
|
|
567
567
|
)
|
|
568
568
|
.then((stdout, error) => {
|
|
569
569
|
if (!error) {
|
|
570
|
-
|
|
570
|
+
const devices = stdout.toString().split(/\n\s*\n/);
|
|
571
571
|
devices.shift();
|
|
572
|
-
devices.forEach(
|
|
573
|
-
|
|
572
|
+
devices.forEach((device) => {
|
|
573
|
+
const lines = device.split('\r\n');
|
|
574
574
|
const dataWidth = util.toInt(util.getValue(lines, 'DataWidth', ':'));
|
|
575
575
|
const totalWidth = util.toInt(util.getValue(lines, 'TotalWidth', ':'));
|
|
576
576
|
const size = parseInt(util.getValue(lines, 'Capacity', ':'), 10) || 0;
|
|
@@ -599,7 +599,7 @@ function memLayout(callback) {
|
|
|
599
599
|
}
|
|
600
600
|
resolve(result);
|
|
601
601
|
});
|
|
602
|
-
} catch
|
|
602
|
+
} catch {
|
|
603
603
|
if (callback) {
|
|
604
604
|
callback(result);
|
|
605
605
|
}
|
package/lib/network.js
CHANGED
|
@@ -119,7 +119,7 @@ function getDefaultNetworkInterface() {
|
|
|
119
119
|
ifacename = ifacename.split(':')[1].trim();
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
} catch
|
|
122
|
+
} catch {
|
|
123
123
|
util.noop();
|
|
124
124
|
}
|
|
125
125
|
if (ifacename) {
|
|
@@ -143,7 +143,7 @@ function getMacAddresses() {
|
|
|
143
143
|
} else {
|
|
144
144
|
pathToIp = '';
|
|
145
145
|
}
|
|
146
|
-
} catch
|
|
146
|
+
} catch {
|
|
147
147
|
pathToIp = '';
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -172,14 +172,14 @@ function getMacAddresses() {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
} catch
|
|
175
|
+
} catch {
|
|
176
176
|
util.noop();
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
if (_darwin) {
|
|
180
180
|
try {
|
|
181
181
|
const cmd = '/sbin/ifconfig';
|
|
182
|
-
|
|
182
|
+
const res = execSync(cmd);
|
|
183
183
|
const lines = res.toString().split('\n');
|
|
184
184
|
for (let i = 0; i < lines.length; i++) {
|
|
185
185
|
if (lines[i] && lines[i][0] !== '\t' && lines[i].indexOf(':') > 0) {
|
|
@@ -193,7 +193,7 @@ function getMacAddresses() {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
} catch
|
|
196
|
+
} catch {
|
|
197
197
|
util.noop();
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -223,11 +223,11 @@ function parseLinesWindowsNics(sections, nconfigsections) {
|
|
|
223
223
|
try {
|
|
224
224
|
if ({}.hasOwnProperty.call(sections, i)) {
|
|
225
225
|
if (sections[i].trim() !== '') {
|
|
226
|
-
|
|
226
|
+
const lines = sections[i].trim().split('\r\n');
|
|
227
227
|
let linesNicConfig = null;
|
|
228
228
|
try {
|
|
229
229
|
linesNicConfig = nconfigsections && nconfigsections[i] ? nconfigsections[i].trim().split('\r\n') : [];
|
|
230
|
-
} catch
|
|
230
|
+
} catch {
|
|
231
231
|
util.noop();
|
|
232
232
|
}
|
|
233
233
|
const netEnabled = util.getValue(lines, 'NetEnabled', ':');
|
|
@@ -252,7 +252,7 @@ function parseLinesWindowsNics(sections, nconfigsections) {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
} catch
|
|
255
|
+
} catch {
|
|
256
256
|
util.noop();
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -271,7 +271,7 @@ function getWindowsNics() {
|
|
|
271
271
|
const nconfigsections = (data[1] || '').split(/\n\s*\n/);
|
|
272
272
|
resolve(parseLinesWindowsNics(nsections, nconfigsections));
|
|
273
273
|
});
|
|
274
|
-
} catch
|
|
274
|
+
} catch {
|
|
275
275
|
resolve([]);
|
|
276
276
|
}
|
|
277
277
|
});
|
|
@@ -281,7 +281,7 @@ function getWindowsNics() {
|
|
|
281
281
|
function getWindowsDNSsuffixes() {
|
|
282
282
|
let iface = {};
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
const dnsSuffixes = {
|
|
285
285
|
primaryDNS: '',
|
|
286
286
|
exitCode: 0,
|
|
287
287
|
ifaces: []
|
|
@@ -319,7 +319,7 @@ function getWindowsDNSsuffixes() {
|
|
|
319
319
|
});
|
|
320
320
|
|
|
321
321
|
return dnsSuffixes;
|
|
322
|
-
} catch
|
|
322
|
+
} catch {
|
|
323
323
|
return {
|
|
324
324
|
primaryDNS: '',
|
|
325
325
|
exitCode: 0,
|
|
@@ -345,7 +345,7 @@ function getWindowsIfaceDNSsuffix(ifaces, ifacename) {
|
|
|
345
345
|
dnsSuffix = '';
|
|
346
346
|
}
|
|
347
347
|
return dnsSuffix;
|
|
348
|
-
} catch
|
|
348
|
+
} catch {
|
|
349
349
|
return 'Unknown';
|
|
350
350
|
}
|
|
351
351
|
}
|
|
@@ -369,12 +369,12 @@ function getWindowsWirelessIfaceSSID(interfaceName) {
|
|
|
369
369
|
const SSID = result.split('\r\n').shift();
|
|
370
370
|
const parseSSID = SSID.split(':').pop().trim();
|
|
371
371
|
return parseSSID;
|
|
372
|
-
} catch
|
|
372
|
+
} catch {
|
|
373
373
|
return 'Unknown';
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
|
377
|
-
|
|
377
|
+
const i8021x = {
|
|
378
378
|
state: 'Unknown',
|
|
379
379
|
protocol: 'Unknown'
|
|
380
380
|
};
|
|
@@ -406,7 +406,7 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
|
|
406
406
|
i8021x.protocol = protocol8021x.split(':').pop();
|
|
407
407
|
i8021x.state = 'Enabled';
|
|
408
408
|
}
|
|
409
|
-
} catch
|
|
409
|
+
} catch {
|
|
410
410
|
return i8021x;
|
|
411
411
|
}
|
|
412
412
|
} else if (connectionType === 'wireless') {
|
|
@@ -434,7 +434,7 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
|
|
434
434
|
i8021x.state = i8021xState.split(':').pop();
|
|
435
435
|
i8021x.protocol = i8021xProtocol.split(':').pop();
|
|
436
436
|
}
|
|
437
|
-
} catch
|
|
437
|
+
} catch {
|
|
438
438
|
if (error.status === 1 && error.stdout.includes('AutoConfig')) {
|
|
439
439
|
i8021x.state = 'Disabled';
|
|
440
440
|
i8021x.protocol = 'Not defined';
|
|
@@ -465,9 +465,9 @@ function splitSectionsNics(lines) {
|
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
function parseLinesDarwinNics(sections) {
|
|
468
|
-
|
|
468
|
+
const nics = [];
|
|
469
469
|
sections.forEach((section) => {
|
|
470
|
-
|
|
470
|
+
const nic = {
|
|
471
471
|
iface: '',
|
|
472
472
|
mtu: null,
|
|
473
473
|
mac: '',
|
|
@@ -947,7 +947,7 @@ function networkInterfaces(callback, rescan, defaultString) {
|
|
|
947
947
|
ip6 = ip6link;
|
|
948
948
|
ip6subnet = ip6linksubnet;
|
|
949
949
|
}
|
|
950
|
-
const iface = dev.split(':')[0].trim()
|
|
950
|
+
const iface = dev.split(':')[0].trim();
|
|
951
951
|
let ifaceSanitized = '';
|
|
952
952
|
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
|
|
953
953
|
const l = util.mathMin(s.length, 2000);
|
|
@@ -1290,7 +1290,7 @@ function networkStats(ifaces, callback) {
|
|
|
1290
1290
|
Object.setPrototypeOf(ifaces, util.stringObj);
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
-
ifaces = ifaces.trim().
|
|
1293
|
+
ifaces = ifaces.trim().replace(/,+/g, '|');
|
|
1294
1294
|
ifacesArray = ifaces.split('|');
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
@@ -1334,11 +1334,11 @@ function networkStats(ifaces, callback) {
|
|
|
1334
1334
|
|
|
1335
1335
|
function networkStatsSingle(iface) {
|
|
1336
1336
|
function parseLinesWindowsPerfData(sections) {
|
|
1337
|
-
|
|
1337
|
+
const perfData = [];
|
|
1338
1338
|
for (let i in sections) {
|
|
1339
1339
|
if ({}.hasOwnProperty.call(sections, i)) {
|
|
1340
1340
|
if (sections[i].trim() !== '') {
|
|
1341
|
-
|
|
1341
|
+
const lines = sections[i].trim().split('\r\n');
|
|
1342
1342
|
perfData.push({
|
|
1343
1343
|
name: util
|
|
1344
1344
|
.getValue(lines, 'Name', ':')
|
|
@@ -1477,7 +1477,7 @@ function networkStatsSingle(iface) {
|
|
|
1477
1477
|
result.operstate = (result.operstate || '').toLowerCase();
|
|
1478
1478
|
result.operstate = result.operstate === 'active' ? 'up' : result.operstate === 'inactive' ? 'down' : 'unknown';
|
|
1479
1479
|
cmd = 'netstat -bdI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]
|
|
1480
|
-
exec(cmd,
|
|
1480
|
+
exec(cmd, (error, stdout) => {
|
|
1481
1481
|
if (!error) {
|
|
1482
1482
|
lines = stdout.toString().split('\n');
|
|
1483
1483
|
// if there is less than 2 lines, no information for this interface was found
|
|
@@ -1595,7 +1595,7 @@ function getProcessName(processes, pid) {
|
|
|
1595
1595
|
function networkConnections(callback) {
|
|
1596
1596
|
return new Promise((resolve) => {
|
|
1597
1597
|
process.nextTick(() => {
|
|
1598
|
-
|
|
1598
|
+
const result = [];
|
|
1599
1599
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
|
1600
1600
|
let cmd =
|
|
1601
1601
|
'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
|
|
@@ -1689,13 +1689,6 @@ function networkConnections(callback) {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
|
-
// if (line.length >= 7 && line[6].indexOf('users:') > -1) {
|
|
1693
|
-
// const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
|
|
1694
|
-
// if (proc.length > 2) {
|
|
1695
|
-
// process = proc[0].split(' ')[0].split(':')[0];
|
|
1696
|
-
// pid = parseInt(proc[1], 10);
|
|
1697
|
-
// }
|
|
1698
|
-
// }
|
|
1699
1692
|
if (connstate) {
|
|
1700
1693
|
result.push({
|
|
1701
1694
|
protocol: line[0],
|
|
@@ -1806,7 +1799,7 @@ function networkConnections(callback) {
|
|
|
1806
1799
|
if (line.length >= 4) {
|
|
1807
1800
|
let localip = line[1];
|
|
1808
1801
|
let localport = '';
|
|
1809
|
-
|
|
1802
|
+
const localaddress = line[1].split(':');
|
|
1810
1803
|
if (localaddress.length > 1) {
|
|
1811
1804
|
localport = localaddress[localaddress.length - 1];
|
|
1812
1805
|
localaddress.pop();
|
|
@@ -1815,14 +1808,14 @@ function networkConnections(callback) {
|
|
|
1815
1808
|
localip = localip.replace(/\[/g, '').replace(/\]/g, '');
|
|
1816
1809
|
let peerip = line[2];
|
|
1817
1810
|
let peerport = '';
|
|
1818
|
-
|
|
1811
|
+
const peeraddress = line[2].split(':');
|
|
1819
1812
|
if (peeraddress.length > 1) {
|
|
1820
1813
|
peerport = peeraddress[peeraddress.length - 1];
|
|
1821
1814
|
peeraddress.pop();
|
|
1822
1815
|
peerip = peeraddress.join(':');
|
|
1823
1816
|
}
|
|
1824
1817
|
peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
|
|
1825
|
-
|
|
1818
|
+
const pid = util.toInt(line[4]);
|
|
1826
1819
|
let connstate = line[3];
|
|
1827
1820
|
if (connstate === 'HERGESTELLT') {
|
|
1828
1821
|
connstate = 'ESTABLISHED';
|
|
@@ -1901,7 +1894,7 @@ function networkGatewayDefault(callback) {
|
|
|
1901
1894
|
process.nextTick(() => {
|
|
1902
1895
|
let result = '';
|
|
1903
1896
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
|
1904
|
-
|
|
1897
|
+
const cmd = 'ip route get 1';
|
|
1905
1898
|
try {
|
|
1906
1899
|
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
|
|
1907
1900
|
if (!error) {
|
package/lib/printer.js
CHANGED
|
@@ -117,7 +117,7 @@ function printer(callback) {
|
|
|
117
117
|
let result = [];
|
|
118
118
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
|
119
119
|
let cmd = 'cat /etc/cups/printers.conf 2>/dev/null';
|
|
120
|
-
exec(cmd,
|
|
120
|
+
exec(cmd, (error, stdout) => {
|
|
121
121
|
// printers.conf
|
|
122
122
|
if (!error) {
|
|
123
123
|
const parts = stdout.toString().split('<Printer ');
|
|
@@ -135,7 +135,7 @@ function printer(callback) {
|
|
|
135
135
|
if (_linux) {
|
|
136
136
|
cmd = 'export LC_ALL=C; lpstat -lp 2>/dev/null; unset LC_ALL';
|
|
137
137
|
// lpstat
|
|
138
|
-
exec(cmd,
|
|
138
|
+
exec(cmd, (error, stdout) => {
|
|
139
139
|
const parts = ('\n' + stdout.toString()).split('\nprinter ');
|
|
140
140
|
for (let i = 1; i < parts.length; i++) {
|
|
141
141
|
const printers = parseLinuxLpstatPrinter(parts[i].split('\n'), i);
|
|
@@ -162,7 +162,7 @@ function printer(callback) {
|
|
|
162
162
|
}
|
|
163
163
|
if (_darwin) {
|
|
164
164
|
let cmd = 'system_profiler SPPrintersDataType -json';
|
|
165
|
-
exec(cmd,
|
|
165
|
+
exec(cmd, (error, stdout) => {
|
|
166
166
|
if (!error) {
|
|
167
167
|
try {
|
|
168
168
|
const outObj = JSON.parse(stdout.toString());
|
|
@@ -172,7 +172,7 @@ function printer(callback) {
|
|
|
172
172
|
result.push(printer);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
} catch
|
|
175
|
+
} catch {
|
|
176
176
|
util.noop();
|
|
177
177
|
}
|
|
178
178
|
}
|
package/lib/users.js
CHANGED
package/lib/util.js
CHANGED
|
@@ -479,7 +479,7 @@ function powerShell(cmd) {
|
|
|
479
479
|
const spanOptions =
|
|
480
480
|
osVersion[0] < 10
|
|
481
481
|
? ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-']
|
|
482
|
-
: ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-ExecutionPolicy', 'Unrestricted', '-Command', cmd];
|
|
482
|
+
: ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-ExecutionPolicy', 'Unrestricted', '-Command', _psToUTF8 + cmd];
|
|
483
483
|
const child = spawn(_powerShell, spanOptions, {
|
|
484
484
|
stdio: 'pipe',
|
|
485
485
|
windowsHide: true,
|
package/lib/virtualbox.js
CHANGED
|
@@ -23,7 +23,7 @@ function vboxInfo(callback) {
|
|
|
23
23
|
return new Promise((resolve) => {
|
|
24
24
|
process.nextTick(() => {
|
|
25
25
|
try {
|
|
26
|
-
exec(util.getVboxmanage() + ' list vms --long',
|
|
26
|
+
exec(util.getVboxmanage() + ' list vms --long', (error, stdout) => {
|
|
27
27
|
let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');
|
|
28
28
|
parts.shift();
|
|
29
29
|
parts.forEach((part) => {
|
|
@@ -38,7 +38,7 @@ function vboxInfo(callback) {
|
|
|
38
38
|
const offset = sinceDateObj.getTimezoneOffset();
|
|
39
39
|
runningSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;
|
|
40
40
|
}
|
|
41
|
-
} catch
|
|
41
|
+
} catch {
|
|
42
42
|
util.noop();
|
|
43
43
|
}
|
|
44
44
|
const stoppedSinceString = !running ? state.replace('powered off (since', '').replace(')', '').trim() : '';
|
|
@@ -49,7 +49,7 @@ function vboxInfo(callback) {
|
|
|
49
49
|
const offset = sinceDateObj.getTimezoneOffset();
|
|
50
50
|
stoppedSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;
|
|
51
51
|
}
|
|
52
|
-
} catch
|
|
52
|
+
} catch {
|
|
53
53
|
util.noop();
|
|
54
54
|
}
|
|
55
55
|
result.push({
|
|
@@ -97,7 +97,7 @@ function vboxInfo(callback) {
|
|
|
97
97
|
}
|
|
98
98
|
resolve(result);
|
|
99
99
|
});
|
|
100
|
-
} catch
|
|
100
|
+
} catch {
|
|
101
101
|
if (callback) {
|
|
102
102
|
callback(result);
|
|
103
103
|
}
|
package/lib/wifi.js
CHANGED
|
@@ -157,7 +157,7 @@ function ifaceListLinux() {
|
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
return result;
|
|
160
|
-
} catch
|
|
160
|
+
} catch {
|
|
161
161
|
try {
|
|
162
162
|
const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null', util.execOptsLinux).toString();
|
|
163
163
|
const parts = all.split('\n\n');
|
|
@@ -179,7 +179,7 @@ function ifaceListLinux() {
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
return result;
|
|
182
|
-
} catch
|
|
182
|
+
} catch {
|
|
183
183
|
return [];
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -198,7 +198,7 @@ function nmiDeviceLinux(iface) {
|
|
|
198
198
|
mac: util.getValue(lines, 'GENERAL.HWADDR').toLowerCase(),
|
|
199
199
|
ssid: ssid !== '--' ? ssid : null
|
|
200
200
|
};
|
|
201
|
-
} catch
|
|
201
|
+
} catch {
|
|
202
202
|
return {};
|
|
203
203
|
}
|
|
204
204
|
}
|
|
@@ -216,7 +216,7 @@ function nmiConnectionLinux(ssid) {
|
|
|
216
216
|
security: util.getValue(lines, '802-11-wireless-security.key-mgmt'),
|
|
217
217
|
bssid: bssid !== '--' ? bssid : null
|
|
218
218
|
};
|
|
219
|
-
} catch
|
|
219
|
+
} catch {
|
|
220
220
|
return {};
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -237,7 +237,7 @@ function wpaConnectionLinux(iface) {
|
|
|
237
237
|
channel: wifiChannelFromFrequencs(freq),
|
|
238
238
|
bssid: util.getValue(lines, 'bssid', '=').toLowerCase()
|
|
239
239
|
};
|
|
240
|
-
} catch
|
|
240
|
+
} catch {
|
|
241
241
|
return {};
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -272,7 +272,7 @@ function getWifiNetworkListNmi() {
|
|
|
272
272
|
});
|
|
273
273
|
});
|
|
274
274
|
return result;
|
|
275
|
-
} catch
|
|
275
|
+
} catch {
|
|
276
276
|
return [];
|
|
277
277
|
}
|
|
278
278
|
}
|
|
@@ -363,7 +363,7 @@ function getWifiNetworkListIw(iface) {
|
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
return result;
|
|
366
|
-
} catch
|
|
366
|
+
} catch {
|
|
367
367
|
return -1;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
@@ -404,7 +404,7 @@ function parseWifiDarwin(wifiStr) {
|
|
|
404
404
|
});
|
|
405
405
|
});
|
|
406
406
|
return result;
|
|
407
|
-
} catch
|
|
407
|
+
} catch {
|
|
408
408
|
return result;
|
|
409
409
|
}
|
|
410
410
|
}
|
|
@@ -460,7 +460,7 @@ function wifiNetworks(callback) {
|
|
|
460
460
|
}
|
|
461
461
|
resolve(result);
|
|
462
462
|
}
|
|
463
|
-
} catch
|
|
463
|
+
} catch {
|
|
464
464
|
if (callback) {
|
|
465
465
|
callback(result);
|
|
466
466
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.30.
|
|
3
|
+
"version": "5.30.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)",
|