diff --git a/LICENSE b/LICENSE
index 0dbbfc8..f4cd23c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014-2025 Sebastian Hildebrandt
+Copyright (c) 2014-2026 Sebastian Hildebrandt
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/README.md b/README.md
index 755cadb..140527a 100644
--- a/README.md
+++ b/README.md
@@ -1177,7 +1177,7 @@ All other trademarks are the property of their respective owners.
> The [`MIT`][license-url] License (MIT)
>
-> Copyright © 2014-2025 Sebastian Hildebrandt,
+> Copyright © 2014-2026 Sebastian Hildebrandt,
> [+innovations](http://www.plus-innovations.com).
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/docs/audio.html b/docs/audio.html
index 69d5eb3..0233af8 100644
--- a/docs/audio.html
+++ b/docs/audio.html
@@ -262,7 +262,7 @@ si.audio().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/battery.html b/docs/battery.html
index e883941..9632221 100644
--- a/docs/battery.html
+++ b/docs/battery.html
@@ -308,7 +308,7 @@ si.battery().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/bluetooth.html b/docs/bluetooth.html
index 633a0fa..c67c114 100644
--- a/docs/bluetooth.html
+++ b/docs/bluetooth.html
@@ -226,7 +226,7 @@ si.bluetoothDevices().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/changes.html b/docs/changes.html
index 487a9cd..03b5bff 100644
--- a/docs/changes.html
+++ b/docs/changes.html
@@ -271,7 +271,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/contributors.html b/docs/contributors.html
index b032257..9924e58 100644
--- a/docs/contributors.html
+++ b/docs/contributors.html
@@ -110,7 +110,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/copyright.html b/docs/copyright.html
index ac32762..49aa24a 100644
--- a/docs/copyright.html
+++ b/docs/copyright.html
@@ -122,7 +122,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/cpu.html b/docs/cpu.html
index bb1e78f..9ba2db8 100644
--- a/docs/cpu.html
+++ b/docs/cpu.html
@@ -646,7 +646,7 @@ si.cpuTemperature().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/docker.html b/docs/docker.html
index 5f230ab..27ecdf9 100644
--- a/docs/docker.html
+++ b/docs/docker.html
@@ -1346,7 +1346,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/filesystem.html b/docs/filesystem.html
index ad6b29a..3b29168 100644
--- a/docs/filesystem.html
+++ b/docs/filesystem.html
@@ -1001,7 +1001,7 @@ setInterval(function() {
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/general.html b/docs/general.html
index 332c815..59b7cd2 100644
--- a/docs/general.html
+++ b/docs/general.html
@@ -401,7 +401,7 @@ si.get(valueObject).then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/gettingstarted.html b/docs/gettingstarted.html
index 114691e..54900f8 100644
--- a/docs/gettingstarted.html
+++ b/docs/gettingstarted.html
@@ -168,7 +168,7 @@ async function cpuData() {
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/graphics.html b/docs/graphics.html
index 9da79c1..76b61c2 100644
--- a/docs/graphics.html
+++ b/docs/graphics.html
@@ -647,7 +647,7 @@ si.graphics().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/history.html b/docs/history.html
index 49d34b5..470d425 100644
--- a/docs/history.html
+++ b/docs/history.html
@@ -3677,7 +3677,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/index.html b/docs/index.html
index fdc5cf3..a4a70d7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -384,7 +384,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/issues.html b/docs/issues.html
index 36fd8e7..a6b63f3 100644
--- a/docs/issues.html
+++ b/docs/issues.html
@@ -126,7 +126,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/memory.html b/docs/memory.html
index ab22f8e..38cda6c 100644
--- a/docs/memory.html
+++ b/docs/memory.html
@@ -461,7 +461,7 @@ si.memLayout().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/network.html b/docs/network.html
index c0c43b7..593159c 100644
--- a/docs/network.html
+++ b/docs/network.html
@@ -848,7 +848,7 @@ setInterval(function() {
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/os.html b/docs/os.html
index 90b641c..7e5f7d9 100644
--- a/docs/os.html
+++ b/docs/os.html
@@ -853,7 +853,7 @@ si.users().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/printer.html b/docs/printer.html
index 98da207..d4878af 100644
--- a/docs/printer.html
+++ b/docs/printer.html
@@ -239,7 +239,7 @@ si.printer().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/processes.html b/docs/processes.html
index 2e12fb6..083e568 100644
--- a/docs/processes.html
+++ b/docs/processes.html
@@ -781,7 +781,7 @@ si.services('mysql, postgres').then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/security.html b/docs/security.html
index 99476ab..85feb74 100644
--- a/docs/security.html
+++ b/docs/security.html
@@ -289,7 +289,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/statsfunctions.html b/docs/statsfunctions.html
index 83b29f2..361cfc3 100644
--- a/docs/statsfunctions.html
+++ b/docs/statsfunctions.html
@@ -157,7 +157,7 @@ setTimeout(() => {
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/system.html b/docs/system.html
index 7b2c21e..35aa0ff 100644
--- a/docs/system.html
+++ b/docs/system.html
@@ -587,7 +587,7 @@ si.chassis().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/tests.html b/docs/tests.html
index 071aaa7..a0b53be 100644
--- a/docs/tests.html
+++ b/docs/tests.html
@@ -142,7 +142,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/trademarks.html b/docs/trademarks.html
index 3f56676..fb0fa9e 100644
--- a/docs/trademarks.html
+++ b/docs/trademarks.html
@@ -119,7 +119,7 @@
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/usb.html b/docs/usb.html
index 4da4541..15dcfc2 100644
--- a/docs/usb.html
+++ b/docs/usb.html
@@ -274,7 +274,7 @@ si.usb().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/docs/v4/battery.html b/docs/v4/battery.html
index 3800558..b5a4c3a 100644
--- a/docs/v4/battery.html
+++ b/docs/v4/battery.html
@@ -291,7 +291,7 @@ si.battery().then(data => console.log(data));
diff --git a/docs/wifi.html b/docs/wifi.html
index 064f81b..add8ad1 100644
--- a/docs/wifi.html
+++ b/docs/wifi.html
@@ -524,7 +524,7 @@ si.wifiConnections().then(data => console.log(data));
Trademarks
Copyright & License
- © 2025 Sebastian Hildebrandt
+ © 2026 Sebastian Hildebrandt
+innovations GmbH
diff --git a/lib/audio.js b/lib/audio.js
index fb45234..f424b54 100644
--- a/lib/audio.js
+++ b/lib/audio.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/battery.js b/lib/battery.js
index 990db85..53ed9be 100644
--- a/lib/battery.js
+++ b/lib/battery.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/bluetooth.js b/lib/bluetooth.js
index 6a67585..569951c 100644
--- a/lib/bluetooth.js
+++ b/lib/bluetooth.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/cli.js b/lib/cli.js
index f5d0e8d..86029f8 100755
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -7,7 +7,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/cpu.js b/lib/cpu.js
index aa15ad0..998bf10 100644
--- a/lib/cpu.js
+++ b/lib/cpu.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/docker.js b/lib/docker.js
index 9dee593..1db4ed0 100644
--- a/lib/docker.js
+++ b/lib/docker.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -17,13 +17,12 @@ const util = require('./util');
const DockerSocket = require('./dockerSocket');
let _platform = process.platform;
-const _windows = (_platform === 'win32');
+const _windows = _platform === 'win32';
let _docker_container_stats = {};
let _docker_socket;
let _docker_last_read = 0;
-
// --------------------------
// get containers (parameter all: get also inactive/exited containers)
@@ -82,7 +81,9 @@ function dockerInfo(callback) {
result.isolation = data.Isolation;
result.initBinary = data.InitBinary;
result.productLicense = data.ProductLicense;
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
});
@@ -92,7 +93,6 @@ function dockerInfo(callback) {
exports.dockerInfo = dockerInfo;
function dockerImages(all, callback) {
-
// fallback - if only callback is given
if (util.isFunction(all) && !callback) {
callback = all;
@@ -114,36 +114,40 @@ function dockerImages(all, callback) {
}
const workload = [];
- _docker_socket.listImages(all, data => {
+ _docker_socket.listImages(all, (data) => {
let dockerImages = {};
try {
dockerImages = data;
if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) {
-
dockerImages.forEach(function (element) {
-
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
}
workload.push(dockerImagesInspect(element.Id.trim(), element));
});
if (workload.length) {
- Promise.all(
- workload
- ).then((data) => {
- if (callback) { callback(data); }
+ Promise.all(workload).then((data) => {
+ if (callback) {
+ callback(data);
+ }
resolve(data);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} catch (err) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -163,12 +167,11 @@ function dockerImagesInspect(imageID, payload) {
}
const imageIDSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(imageID, true)).trim();
if (imageIDSanitized) {
-
if (!_docker_socket) {
_docker_socket = new DockerSocket();
}
- _docker_socket.inspectImage(imageIDSanitized.trim(), data => {
+ _docker_socket.inspectImage(imageIDSanitized.trim(), (data) => {
try {
resolve({
id: payload.Id,
@@ -188,7 +191,7 @@ function dockerImagesInspect(imageID, payload) {
repoDigests: data.RepoDigests ? data.RepoDigests : {},
repoTags: data.RepoTags ? data.RepoTags : {},
config: data.Config ? data.Config : {},
- rootFS: data.RootFS ? data.RootFS : {},
+ rootFS: data.RootFS ? data.RootFS : {}
});
} catch (err) {
resolve();
@@ -204,16 +207,15 @@ function dockerImagesInspect(imageID, payload) {
exports.dockerImages = dockerImages;
function dockerContainers(all, callback) {
-
function inContainers(containers, id) {
- let filtered = containers.filter(obj => {
+ let filtered = containers.filter((obj) => {
/**
* @namespace
* @property {string} Id
*/
- return (obj.Id && (obj.Id === id));
+ return obj.Id && obj.Id === id;
});
- return (filtered.length > 0);
+ return filtered.length > 0;
}
// fallback - if only callback is given
@@ -237,7 +239,7 @@ function dockerContainers(all, callback) {
}
const workload = [];
- _docker_socket.listContainers(all, data => {
+ _docker_socket.listContainers(all, (data) => {
let docker_containers = {};
try {
docker_containers = data;
@@ -245,40 +247,49 @@ function dockerContainers(all, callback) {
// GC in _docker_container_stats
for (let key in _docker_container_stats) {
if ({}.hasOwnProperty.call(_docker_container_stats, key)) {
- if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }
+ if (!inContainers(docker_containers, key)) {
+ delete _docker_container_stats[key];
+ }
}
}
docker_containers.forEach(function (element) {
-
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
}
workload.push(dockerContainerInspect(element.Id.trim(), element));
});
if (workload.length) {
- Promise.all(
- workload
- ).then((data) => {
- if (callback) { callback(data); }
+ Promise.all(workload).then((data) => {
+ if (callback) {
+ callback(data);
+ }
resolve(data);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} catch (err) {
// GC in _docker_container_stats
for (let key in _docker_container_stats) {
if ({}.hasOwnProperty.call(_docker_container_stats, key)) {
- if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }
+ if (!inContainers(docker_containers, key)) {
+ delete _docker_container_stats[key];
+ }
}
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -298,12 +309,11 @@ function dockerContainerInspect(containerID, payload) {
}
const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();
if (containerIdSanitized) {
-
if (!_docker_socket) {
_docker_socket = new DockerSocket();
}
- _docker_socket.getInspect(containerIdSanitized.trim(), data => {
+ _docker_socket.getInspect(containerIdSanitized.trim(), (data) => {
try {
resolve({
id: payload.Id,
@@ -322,7 +332,7 @@ function dockerContainerInspect(containerID, payload) {
platform: data.Platform || '',
driver: data.Driver || '',
ports: payload.Ports,
- mounts: payload.Mounts,
+ mounts: payload.Mounts
// hostconfig: payload.HostConfig,
// network: payload.NetworkSettings
});
@@ -363,8 +373,7 @@ function docker_calcCPUPercent(cpu_stats, precpu_stats) {
// calculate the change for the cpu usage of the container in between readings
if (precpu_stats.online_cpus) {
cpuPercent = (cpuDelta / systemDelta) * precpu_stats.online_cpus * 100.0;
- }
- else {
+ } else {
cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;
}
}
@@ -374,10 +383,10 @@ function docker_calcCPUPercent(cpu_stats, precpu_stats) {
let nanoSecNow = util.nanoSeconds();
let cpuPercent = 0.0;
if (_docker_last_read > 0) {
- let possIntervals = (nanoSecNow - _docker_last_read); // / 100 * os.cpus().length;
+ let possIntervals = nanoSecNow - _docker_last_read; // / 100 * os.cpus().length;
let intervalsUsed = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;
if (possIntervals > 0) {
- cpuPercent = 100.0 * intervalsUsed / possIntervals;
+ cpuPercent = (100.0 * intervalsUsed) / possIntervals;
}
}
_docker_last_read = nanoSecNow;
@@ -390,7 +399,9 @@ function docker_calcNetworkIO(networks) {
let wx;
for (let key in networks) {
// skip loop if the property is from prototype
- if (!{}.hasOwnProperty.call(networks, key)) { continue; }
+ if (!{}.hasOwnProperty.call(networks, key)) {
+ continue;
+ }
/**
* @namespace
@@ -417,7 +428,12 @@ function docker_calcBlockIO(blkio_stats) {
* @namespace
* @property {Array} io_service_bytes_recursive
*/
- if (blkio_stats && blkio_stats.io_service_bytes_recursive && Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' && blkio_stats.io_service_bytes_recursive.length > 0) {
+ if (
+ blkio_stats &&
+ blkio_stats.io_service_bytes_recursive &&
+ Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' &&
+ blkio_stats.io_service_bytes_recursive.length > 0
+ ) {
blkio_stats.io_service_bytes_recursive.forEach(function (element) {
/**
* @namespace
@@ -437,11 +453,9 @@ function docker_calcBlockIO(blkio_stats) {
}
function dockerContainerStats(containerIDs, callback) {
-
let containerArray = [];
return new Promise((resolve) => {
process.nextTick(() => {
-
// fallback - if only callback is given
if (util.isFunction(containerIDs) && !callback) {
callback = containerIDs;
@@ -449,7 +463,9 @@ function dockerContainerStats(containerIDs, callback) {
} else {
containerIDs = containerIDs || '*';
if (typeof containerIDs !== 'string') {
- if (callback) { callback([]); }
+ if (callback) {
+ callback([]);
+ }
return resolve([]);
}
let containerIDsSanitized = '';
@@ -491,17 +507,21 @@ function dockerContainerStats(containerIDs, callback) {
const workload = [];
if (containerArray.length && containerArray[0].trim() === '*') {
containerArray = [];
- dockerContainers().then(allContainers => {
+ dockerContainers().then((allContainers) => {
for (let container of allContainers) {
containerArray.push(container.id.substring(0, 12));
}
if (containerArray.length) {
- dockerContainerStats(containerArray.join(',')).then(result => {
- if (callback) { callback(result); }
+ dockerContainerStats(containerArray.join(',')).then((result) => {
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -510,14 +530,16 @@ function dockerContainerStats(containerIDs, callback) {
workload.push(dockerContainerStatsSingle(containerID.trim()));
}
if (workload.length) {
- Promise.all(
- workload
- ).then((data) => {
- if (callback) { callback(data); }
+ Promise.all(workload).then((data) => {
+ if (callback) {
+ callback(data);
+ }
resolve(data);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
@@ -549,35 +571,40 @@ function dockerContainerStatsSingle(containerID) {
cpuStats: {},
precpuStats: {},
memoryStats: {},
- networks: {},
+ networks: {}
};
return new Promise((resolve) => {
process.nextTick(() => {
if (containerID) {
-
if (!_docker_socket) {
_docker_socket = new DockerSocket();
}
- _docker_socket.getInspect(containerID, dataInspect => {
+ _docker_socket.getInspect(containerID, (dataInspect) => {
try {
- _docker_socket.getStats(containerID, data => {
+ _docker_socket.getStats(containerID, (data) => {
try {
let stats = data;
if (!stats.message) {
- if (data.id) { result.id = data.id; }
- result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0);
- result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0);
- result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);
- result.cpuPercent = (stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0);
- result.pids = (stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0);
- result.restartCount = (dataInspect.RestartCount ? dataInspect.RestartCount : 0);
- if (stats.networks) { result.netIO = docker_calcNetworkIO(stats.networks); }
- if (stats.blkio_stats) { result.blockIO = docker_calcBlockIO(stats.blkio_stats); }
- result.cpuStats = (stats.cpu_stats ? stats.cpu_stats : {});
- result.precpuStats = (stats.precpu_stats ? stats.precpu_stats : {});
- result.memoryStats = (stats.memory_stats ? stats.memory_stats : {});
- result.networks = (stats.networks ? stats.networks : {});
+ if (data.id) {
+ result.id = data.id;
+ }
+ result.memUsage = stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0;
+ result.memLimit = stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0;
+ result.memPercent = stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? (stats.memory_stats.usage / stats.memory_stats.limit) * 100.0 : 0;
+ result.cpuPercent = stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0;
+ result.pids = stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0;
+ result.restartCount = dataInspect.RestartCount ? dataInspect.RestartCount : 0;
+ if (stats.networks) {
+ result.netIO = docker_calcNetworkIO(stats.networks);
+ }
+ if (stats.blkio_stats) {
+ result.blockIO = docker_calcBlockIO(stats.blkio_stats);
+ }
+ result.cpuStats = stats.cpu_stats ? stats.cpu_stats : {};
+ result.precpuStats = stats.precpu_stats ? stats.precpu_stats : {};
+ result.memoryStats = stats.memory_stats ? stats.memory_stats : {};
+ result.networks = stats.networks ? stats.networks : {};
}
} catch (err) {
util.noop();
@@ -612,12 +639,11 @@ function dockerContainerProcesses(containerID, callback) {
const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();
if (containerIdSanitized) {
-
if (!_docker_socket) {
_docker_socket = new DockerSocket();
}
- _docker_socket.getProcesses(containerIdSanitized, data => {
+ _docker_socket.getProcesses(containerIdSanitized, (data) => {
/**
* @namespace
* @property {Array} Titles
@@ -643,33 +669,37 @@ function dockerContainerProcesses(containerID, callback) {
let pos_rss = titles.indexOf('RSS');
let pos_command = titles.indexOf('COMMAND');
- data.Processes.forEach(process => {
+ data.Processes.forEach((process) => {
result.push({
- pidHost: (pos_pid >= 0 ? process[pos_pid] : ''),
- ppid: (pos_ppid >= 0 ? process[pos_ppid] : ''),
- pgid: (pos_pgid >= 0 ? process[pos_pgid] : ''),
- user: (pos_user >= 0 ? process[pos_user] : ''),
- ruser: (pos_ruser >= 0 ? process[pos_ruser] : ''),
- group: (pos_group >= 0 ? process[pos_group] : ''),
- rgroup: (pos_rgroup >= 0 ? process[pos_rgroup] : ''),
- stat: (pos_stat >= 0 ? process[pos_stat] : ''),
- time: (pos_time >= 0 ? process[pos_time] : ''),
- elapsed: (pos_elapsed >= 0 ? process[pos_elapsed] : ''),
- nice: (pos_ni >= 0 ? process[pos_ni] : ''),
- rss: (pos_rss >= 0 ? process[pos_rss] : ''),
- vsz: (pos_vsz >= 0 ? process[pos_vsz] : ''),
- command: (pos_command >= 0 ? process[pos_command] : '')
+ pidHost: pos_pid >= 0 ? process[pos_pid] : '',
+ ppid: pos_ppid >= 0 ? process[pos_ppid] : '',
+ pgid: pos_pgid >= 0 ? process[pos_pgid] : '',
+ user: pos_user >= 0 ? process[pos_user] : '',
+ ruser: pos_ruser >= 0 ? process[pos_ruser] : '',
+ group: pos_group >= 0 ? process[pos_group] : '',
+ rgroup: pos_rgroup >= 0 ? process[pos_rgroup] : '',
+ stat: pos_stat >= 0 ? process[pos_stat] : '',
+ time: pos_time >= 0 ? process[pos_time] : '',
+ elapsed: pos_elapsed >= 0 ? process[pos_elapsed] : '',
+ nice: pos_ni >= 0 ? process[pos_ni] : '',
+ rss: pos_rss >= 0 ? process[pos_rss] : '',
+ vsz: pos_vsz >= 0 ? process[pos_vsz] : '',
+ command: pos_command >= 0 ? process[pos_command] : ''
});
});
}
} catch (err) {
util.noop();
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -679,7 +709,6 @@ function dockerContainerProcesses(containerID, callback) {
exports.dockerContainerProcesses = dockerContainerProcesses;
function dockerVolumes(callback) {
-
let result = [];
return new Promise((resolve) => {
process.nextTick(() => {
@@ -691,9 +720,7 @@ function dockerVolumes(callback) {
try {
dockerVolumes = data;
if (dockerVolumes && dockerVolumes.Volumes && Object.prototype.toString.call(dockerVolumes.Volumes) === '[object Array]' && dockerVolumes.Volumes.length > 0) {
-
dockerVolumes.Volumes.forEach(function (element) {
-
result.push({
name: element.Name,
driver: element.Driver,
@@ -701,17 +728,23 @@ function dockerVolumes(callback) {
mountpoint: element.Mountpoint,
options: element.Options,
scope: element.Scope,
- created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1000) : 0,
+ created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1000) : 0
});
});
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} catch (err) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -724,7 +757,7 @@ exports.dockerVolumes = dockerVolumes;
function dockerAll(callback) {
return new Promise((resolve) => {
process.nextTick(() => {
- dockerContainers(true).then(result => {
+ dockerContainers(true).then((result) => {
if (result && Object.prototype.toString.call(result) === '[object Array]' && result.length > 0) {
let l = result.length;
result.forEach(function (element) {
@@ -742,12 +775,14 @@ function dockerAll(callback) {
element.memoryStats = res[0].memoryStats;
element.networks = res[0].networks;
- dockerContainerProcesses(element.id).then(processes => {
+ dockerContainerProcesses(element.id).then((processes) => {
element.processes = processes;
l -= 1;
if (l === 0) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -755,7 +790,9 @@ function dockerAll(callback) {
});
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
diff --git a/lib/dockerSocket.js b/lib/dockerSocket.js
index 02b4ace..4b94dd5 100644
--- a/lib/dockerSocket.js
+++ b/lib/dockerSocket.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -18,10 +18,8 @@ const isWin = require('os').type() === 'Windows_NT';
const socketPath = isWin ? '//./pipe/docker_engine' : '/var/run/docker.sock';
class DockerSocket {
-
getInfo(callback) {
try {
-
let socket = net.createConnection({ path: socketPath });
let alldata = '';
let data;
@@ -30,7 +28,7 @@ class DockerSocket {
socket.write('GET http:/info HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -57,7 +55,6 @@ class DockerSocket {
listImages(all, callback) {
try {
-
let socket = net.createConnection({ path: socketPath });
let alldata = '';
let data;
@@ -66,7 +63,7 @@ class DockerSocket {
socket.write('GET http:/images/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -103,7 +100,7 @@ class DockerSocket {
socket.write('GET http:/images/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -133,7 +130,6 @@ class DockerSocket {
listContainers(all, callback) {
try {
-
let socket = net.createConnection({ path: socketPath });
let alldata = '';
let data;
@@ -142,7 +138,7 @@ class DockerSocket {
socket.write('GET http:/containers/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -179,7 +175,7 @@ class DockerSocket {
socket.write('GET http:/containers/' + id + '/stats?stream=0 HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -219,7 +215,7 @@ class DockerSocket {
socket.write('GET http:/containers/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -259,7 +255,7 @@ class DockerSocket {
socket.write('GET http:/containers/' + id + '/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
@@ -289,7 +285,6 @@ class DockerSocket {
listVolumes(callback) {
try {
-
let socket = net.createConnection({ path: socketPath });
let alldata = '';
let data;
@@ -298,7 +293,7 @@ class DockerSocket {
socket.write('GET http:/volumes HTTP/1.0\r\n\r\n');
});
- socket.on('data', data => {
+ socket.on('data', (data) => {
alldata = alldata + data.toString();
});
diff --git a/lib/filesystem.js b/lib/filesystem.js
index edf0255..b0da8c7 100644
--- a/lib/filesystem.js
+++ b/lib/filesystem.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/graphics.js b/lib/graphics.js
index 931854d..f7438a0 100644
--- a/lib/graphics.js
+++ b/lib/graphics.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/index.js b/lib/index.js
index a48376d..10b0d72 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// Contributors: Guillaume Legrain (https://github.com/glegrain)
diff --git a/lib/internet.js b/lib/internet.js
index 4b6d61a..21947af 100644
--- a/lib/internet.js
+++ b/lib/internet.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -17,19 +17,18 @@ const util = require('./util');
let _platform = process.platform;
-const _linux = (_platform === 'linux' || _platform === 'android');
-const _darwin = (_platform === 'darwin');
-const _windows = (_platform === 'win32');
-const _freebsd = (_platform === 'freebsd');
-const _openbsd = (_platform === 'openbsd');
-const _netbsd = (_platform === 'netbsd');
-const _sunos = (_platform === 'sunos');
+const _linux = _platform === 'linux' || _platform === 'android';
+const _darwin = _platform === 'darwin';
+const _windows = _platform === 'win32';
+const _freebsd = _platform === 'freebsd';
+const _openbsd = _platform === 'openbsd';
+const _netbsd = _platform === 'netbsd';
+const _sunos = _platform === 'sunos';
// --------------------------
// check if external site is available
function inetChecksite(url, callback) {
-
return new Promise((resolve) => {
process.nextTick(() => {
let result = {
@@ -39,7 +38,9 @@ function inetChecksite(url, callback) {
ms: null
};
if (typeof url !== 'string') {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
return resolve(result);
}
let urlSanitized = '';
@@ -68,24 +69,39 @@ function inetChecksite(url, callback) {
Object.setPrototypeOf(urlSanitized, util.stringObj);
}
- if (urlSanitized.startsWith('file:') || urlSanitized.startsWith('gopher:') || urlSanitized.startsWith('telnet:') || urlSanitized.startsWith('mailto:') || urlSanitized.startsWith('news:') || urlSanitized.startsWith('nntp:')) {
- if (callback) { callback(result); }
+ if (
+ urlSanitized.startsWith('file:') ||
+ urlSanitized.startsWith('gopher:') ||
+ urlSanitized.startsWith('telnet:') ||
+ urlSanitized.startsWith('mailto:') ||
+ urlSanitized.startsWith('news:') ||
+ urlSanitized.startsWith('nntp:')
+ ) {
+ if (callback) {
+ callback(result);
+ }
return resolve(result);
}
util.checkWebsite(urlSanitized).then((res) => {
result.status = res.statusCode;
- result.ok = res.statusCode >= 200 && res.statusCode <= 399;;
- result.ms = (result.ok ? res.time : null);
- if (callback) { callback(result); }
+ result.ok = res.statusCode >= 200 && res.statusCode <= 399;
+ result.ms = result.ok ? res.time : null;
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} catch (err) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -98,7 +114,6 @@ exports.inetChecksite = inetChecksite;
// check inet latency
function inetLatency(host, callback) {
-
// fallback - if only callback is given
if (util.isFunction(host) && !callback) {
callback = host;
@@ -110,7 +125,9 @@ function inetLatency(host, callback) {
return new Promise((resolve) => {
process.nextTick(() => {
if (typeof host !== 'string') {
- if (callback) { callback(null); }
+ if (callback) {
+ callback(null);
+ }
return resolve(null);
}
let hostSanitized = '';
@@ -136,8 +153,17 @@ function inetLatency(host, callback) {
Object.setPrototypeOf(hostSanitized, util.stringObj);
}
- if (hostSanitized.startsWith('file:') || hostSanitized.startsWith('gopher:') || hostSanitized.startsWith('telnet:') || hostSanitized.startsWith('mailto:') || hostSanitized.startsWith('news:') || hostSanitized.startsWith('nntp:')) {
- if (callback) { callback(null); }
+ if (
+ hostSanitized.startsWith('file:') ||
+ hostSanitized.startsWith('gopher:') ||
+ hostSanitized.startsWith('telnet:') ||
+ hostSanitized.startsWith('mailto:') ||
+ hostSanitized.startsWith('news:') ||
+ hostSanitized.startsWith('nntp:')
+ ) {
+ if (callback) {
+ callback(null);
+ }
return resolve(null);
}
let params;
@@ -154,7 +180,10 @@ function inetLatency(host, callback) {
util.execSafe('ping', params).then((stdout) => {
let result = null;
if (stdout) {
- const lines = stdout.split('\n').filter((line) => (line.indexOf('rtt') >= 0 || line.indexOf('round-trip') >= 0 || line.indexOf('avg') >= 0)).join('\n');
+ const lines = stdout
+ .split('\n')
+ .filter((line) => line.indexOf('rtt') >= 0 || line.indexOf('round-trip') >= 0 || line.indexOf('avg') >= 0)
+ .join('\n');
const line = lines.split('=');
if (line.length > 1) {
@@ -164,7 +193,9 @@ function inetLatency(host, callback) {
}
}
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
}
@@ -174,7 +205,10 @@ function inetLatency(host, callback) {
util.execSafe('ping', params, { timeout: 3000 }).then((stdout) => {
let result = null;
if (stdout) {
- const lines = stdout.split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
+ const lines = stdout
+ .split('\n')
+ .filter((line) => line.indexOf(filt) >= 0)
+ .join('\n');
const line = lines.split('=');
if (line.length > 1) {
const parts = line[1].split('/');
@@ -183,7 +217,9 @@ function inetLatency(host, callback) {
}
}
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
}
@@ -204,11 +240,15 @@ function inetLatency(host, callback) {
}
});
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
diff --git a/lib/memory.js b/lib/memory.js
index 620f2d6..ac984e2 100644
--- a/lib/memory.js
+++ b/lib/memory.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -21,13 +21,13 @@ const fs = require('fs');
let _platform = process.platform;
-const _linux = (_platform === 'linux' || _platform === 'android');
-const _darwin = (_platform === 'darwin');
-const _windows = (_platform === 'win32');
-const _freebsd = (_platform === 'freebsd');
-const _openbsd = (_platform === 'openbsd');
-const _netbsd = (_platform === 'netbsd');
-const _sunos = (_platform === 'sunos');
+const _linux = _platform === 'linux' || _platform === 'android';
+const _darwin = _platform === 'darwin';
+const _windows = _platform === 'win32';
+const _freebsd = _platform === 'freebsd';
+const _openbsd = _platform === 'openbsd';
+const _netbsd = _platform === 'netbsd';
+const _sunos = _platform === 'sunos';
const RAM_manufacturers = {
'00CE': 'Samsung Electronics Inc',
@@ -39,24 +39,24 @@ const RAM_manufacturers = {
'04CB': 'A-DATA',
'04CD': 'G.Skill International Enterprise',
'059B': 'Crucial',
- '1315': 'Crucial',
+ 1315: 'Crucial',
'2C00': 'Micron Technology Inc.',
- '5105': 'Qimonda AG i. In.',
+ 5105: 'Qimonda AG i. In.',
'802C': 'Micron Technology Inc.',
'80AD': 'Hynix Semiconductor Inc.',
'80CE': 'Samsung Electronics Inc.',
- '8551': 'Qimonda AG i. In.',
+ 8551: 'Qimonda AG i. In.',
'859B': 'Crucial',
- 'AD00': 'Hynix Semiconductor Inc.',
- 'CE00': 'Samsung Electronics Inc.',
- 'SAMSUNG': 'Samsung Electronics Inc.',
- 'HYNIX': 'Hynix Semiconductor Inc.',
+ AD00: 'Hynix Semiconductor Inc.',
+ CE00: 'Samsung Electronics Inc.',
+ SAMSUNG: 'Samsung Electronics Inc.',
+ HYNIX: 'Hynix Semiconductor Inc.',
'G-SKILL': 'G-Skill International Enterprise',
'G.SKILL': 'G-Skill International Enterprise',
- 'TRANSCEND': 'Transcend Information',
- 'APACER': 'Apacer Technology Inc',
- 'MICRON': 'Micron Technology Inc.',
- 'QIMONDA': 'Qimonda AG i. In.',
+ TRANSCEND: 'Transcend Information',
+ APACER: 'Apacer Technology Inc',
+ MICRON: 'Micron Technology Inc.',
+ QIMONDA: 'Qimonda AG i. In.'
};
// _______________________________________________________________________________________
@@ -137,17 +137,15 @@ const RAM_manufacturers = {
// SUnreclaim: 79352 kB
function mem(callback) {
-
return new Promise((resolve) => {
process.nextTick(() => {
-
let result = {
total: os.totalmem(),
free: os.freemem(),
used: os.totalmem() - os.freemem(),
- active: os.totalmem() - os.freemem(), // temporarily (fallback)
- available: os.freemem(), // temporarily (fallback)
+ active: os.totalmem() - os.freemem(), // temporarily (fallback)
+ available: os.freemem(), // temporarily (fallback)
buffers: 0,
cached: 0,
slab: 0,
@@ -196,45 +194,59 @@ function mem(callback) {
result.reclaimable = parseInt(util.getValue(lines, 'sreclaimable'), 10);
result.reclaimable = result.reclaimable ? result.reclaimable * 1024 : 0;
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
if (_freebsd || _openbsd || _netbsd) {
try {
- exec('/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', function (error, stdout) {
- if (!error) {
- let lines = stdout.toString().split('\n');
- const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);
- const inactive = parseInt(util.getValue(lines, 'vm.stats.vm.v_inactive_count'), 10) * pagesize;
- const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;
+ exec(
+ '/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',
+ function (error, stdout) {
+ if (!error) {
+ let lines = stdout.toString().split('\n');
+ const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);
+ const inactive = parseInt(util.getValue(lines, 'vm.stats.vm.v_inactive_count'), 10) * pagesize;
+ const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;
- result.total = parseInt(util.getValue(lines, 'hw.realmem'), 10);
- if (isNaN(result.total)) { result.total = parseInt(util.getValue(lines, 'hw.physmem'), 10); }
- result.free = parseInt(util.getValue(lines, 'vm.stats.vm.v_free_count'), 10) * pagesize;
- result.buffcache = inactive + cache;
- result.available = result.buffcache + result.free;
- result.active = result.total - result.free - result.buffcache;
-
- result.swaptotal = 0;
- result.swapfree = 0;
- result.swapused = 0;
+ result.total = parseInt(util.getValue(lines, 'hw.realmem'), 10);
+ if (isNaN(result.total)) {
+ result.total = parseInt(util.getValue(lines, 'hw.physmem'), 10);
+ }
+ result.free = parseInt(util.getValue(lines, 'vm.stats.vm.v_free_count'), 10) * pagesize;
+ result.buffcache = inactive + cache;
+ result.available = result.buffcache + result.free;
+ result.active = result.total - result.free - result.buffcache;
+ result.swaptotal = 0;
+ result.swapfree = 0;
+ result.swapused = 0;
+ }
+ if (callback) {
+ callback(result);
+ }
+ resolve(result);
}
- if (callback) { callback(result); }
- resolve(result);
- });
+ );
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
if (_sunos) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
if (_darwin) {
@@ -260,19 +272,29 @@ function mem(callback) {
if (lines.length > 0) {
let firstline = lines[0].replace(/,/g, '.').replace(/M/g, '');
let lineArray = firstline.trim().split(' ');
- lineArray.forEach(line => {
- if (line.toLowerCase().indexOf('total') !== -1) { result.swaptotal = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
- if (line.toLowerCase().indexOf('used') !== -1) { result.swapused = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
- if (line.toLowerCase().indexOf('free') !== -1) { result.swapfree = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
+ lineArray.forEach((line) => {
+ if (line.toLowerCase().indexOf('total') !== -1) {
+ result.swaptotal = parseFloat(line.split('=')[1].trim()) * 1024 * 1024;
+ }
+ if (line.toLowerCase().indexOf('used') !== -1) {
+ result.swapused = parseFloat(line.split('=')[1].trim()) * 1024 * 1024;
+ }
+ if (line.toLowerCase().indexOf('free') !== -1) {
+ result.swapfree = parseFloat(line.split('=')[1].trim()) * 1024 * 1024;
+ }
});
}
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
});
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
@@ -282,7 +304,10 @@ function mem(callback) {
try {
util.powerShell('Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage').then((stdout, error) => {
if (!error) {
- let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);
+ let lines = stdout
+ .split('\r\n')
+ .filter((line) => line.trim() !== '')
+ .filter((line, idx) => idx > 0);
lines.forEach(function (line) {
if (line !== '') {
line = line.trim().split(/\s\s+/);
@@ -295,11 +320,15 @@ function mem(callback) {
result.swapused = swapused * 1024 * 1024;
result.swapfree = result.swaptotal - result.swapused;
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
@@ -310,129 +339,134 @@ function mem(callback) {
exports.mem = mem;
function memLayout(callback) {
-
function getManufacturer(manId) {
const manIdSearch = manId.replace('0x', '').toUpperCase();
if (manIdSearch.length >= 4 && {}.hasOwnProperty.call(RAM_manufacturers, manIdSearch)) {
- return (RAM_manufacturers[manIdSearch]);
+ return RAM_manufacturers[manIdSearch];
}
return manId;
}
return new Promise((resolve) => {
process.nextTick(() => {
-
let result = [];
if (_linux || _freebsd || _openbsd || _netbsd) {
- exec('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', function (error, stdout) {
- if (!error) {
- let devices = stdout.toString().split('Memory Device');
- devices.shift();
- devices.forEach(function (device) {
- let lines = device.split('\n');
- const sizeString = util.getValue(lines, 'Size');
- const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;
- let bank = util.getValue(lines, 'Bank Locator');
- if (bank.toLowerCase().indexOf('bad') >= 0) {
- bank = '';
- }
- if (parseInt(util.getValue(lines, 'Size'), 10) > 0) {
- const totalWidth = util.toInt(util.getValue(lines, 'Total Width'));
- const dataWidth = util.toInt(util.getValue(lines, 'Data Width'));
- result.push({
- size,
- bank,
- type: util.getValue(lines, 'Type:'),
- ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
- clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),
- formFactor: util.getValue(lines, 'Form Factor:'),
- manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer:')),
- partNum: util.getValue(lines, 'Part Number:'),
- serialNum: util.getValue(lines, 'Serial Number:'),
- voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,
- voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,
- voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null,
- });
- } else {
- result.push({
- size: 0,
- bank,
- type: 'Empty',
- ecc: null,
- clockSpeed: 0,
- formFactor: util.getValue(lines, 'Form Factor:'),
- partNum: '',
- serialNum: '',
- voltageConfigured: null,
- voltageMin: null,
- voltageMax: null,
- });
- }
- });
- }
- if (!result.length) {
- result.push({
- size: os.totalmem(),
- bank: '',
- type: '',
- ecc: null,
- clockSpeed: 0,
- formFactor: '',
- partNum: '',
- serialNum: '',
- voltageConfigured: null,
- voltageMin: null,
- voltageMax: null,
- });
-
- // Try Raspberry PI
- try {
- let stdout = execSync('cat /proc/cpuinfo 2>/dev/null', util.execOptsLinux);
- let lines = stdout.toString().split('\n');
- let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
-
- if (util.isRaspberry(lines)) {
-
- const clockSpeed = {
- '0': 400,
- '1': 450,
- '2': 450,
- '3': 3200,
- '4': 4267
- };
- result[0].type = 'LPDDR2';
- result[0].type = version && version[2] && (version[2] === '3') ? 'LPDDR4' : result[0].type;
- result[0].type = version && version[2] && (version[2] === '4') ? 'LPDDR4X' : result[0].type;
- result[0].ecc = false;
- result[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400;
- result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
- result[0].formFactor = 'SoC';
-
- stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null', util.execOptsLinux);
- lines = stdout.toString().split('\n');
- let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
- if (freq) {
- result[0].clockSpeed = freq;
+ exec(
+ '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',
+ function (error, stdout) {
+ if (!error) {
+ let devices = stdout.toString().split('Memory Device');
+ devices.shift();
+ devices.forEach(function (device) {
+ let lines = device.split('\n');
+ const sizeString = util.getValue(lines, 'Size');
+ const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;
+ let bank = util.getValue(lines, 'Bank Locator');
+ if (bank.toLowerCase().indexOf('bad') >= 0) {
+ bank = '';
}
-
- stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null', util.execOptsLinux);
- lines = stdout.toString().split('\n');
- let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;
- if (voltage) {
- result[0].voltageConfigured = voltage;
- result[0].voltageMin = voltage;
- result[0].voltageMax = voltage;
+ if (parseInt(util.getValue(lines, 'Size'), 10) > 0) {
+ const totalWidth = util.toInt(util.getValue(lines, 'Total Width'));
+ const dataWidth = util.toInt(util.getValue(lines, 'Data Width'));
+ result.push({
+ size,
+ bank,
+ type: util.getValue(lines, 'Type:'),
+ ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
+ clockSpeed: util.getValue(lines, 'Configured Clock Speed:')
+ ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10)
+ : util.getValue(lines, 'Speed:')
+ ? parseInt(util.getValue(lines, 'Speed:'), 10)
+ : null,
+ formFactor: util.getValue(lines, 'Form Factor:'),
+ manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer:')),
+ partNum: util.getValue(lines, 'Part Number:'),
+ serialNum: util.getValue(lines, 'Serial Number:'),
+ voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,
+ voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,
+ voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null
+ });
+ } else {
+ result.push({
+ size: 0,
+ bank,
+ type: 'Empty',
+ ecc: null,
+ clockSpeed: 0,
+ formFactor: util.getValue(lines, 'Form Factor:'),
+ partNum: '',
+ serialNum: '',
+ voltageConfigured: null,
+ voltageMin: null,
+ voltageMax: null
+ });
}
- }
- } catch (e) {
- util.noop();
+ });
}
+ if (!result.length) {
+ result.push({
+ size: os.totalmem(),
+ bank: '',
+ type: '',
+ ecc: null,
+ clockSpeed: 0,
+ formFactor: '',
+ partNum: '',
+ serialNum: '',
+ voltageConfigured: null,
+ voltageMin: null,
+ voltageMax: null
+ });
+ // Try Raspberry PI
+ try {
+ let stdout = execSync('cat /proc/cpuinfo 2>/dev/null', util.execOptsLinux);
+ let lines = stdout.toString().split('\n');
+ let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
+
+ if (util.isRaspberry(lines)) {
+ const clockSpeed = {
+ 0: 400,
+ 1: 450,
+ 2: 450,
+ 3: 3200,
+ 4: 4267
+ };
+ result[0].type = 'LPDDR2';
+ result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;
+ result[0].type = version && version[2] && version[2] === '4' ? 'LPDDR4X' : result[0].type;
+ result[0].ecc = false;
+ result[0].clockSpeed = (version && version[2] && clockSpeed[version[2]]) || 400;
+ result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
+ result[0].formFactor = 'SoC';
+
+ stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null', util.execOptsLinux);
+ lines = stdout.toString().split('\n');
+ let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
+ if (freq) {
+ result[0].clockSpeed = freq;
+ }
+
+ stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null', util.execOptsLinux);
+ lines = stdout.toString().split('\n');
+ let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;
+ if (voltage) {
+ result[0].voltageConfigured = voltage;
+ result[0].voltageMin = voltage;
+ result[0].voltageMax = voltage;
+ }
+ }
+ } catch (e) {
+ util.noop();
+ }
+ }
+ if (callback) {
+ callback(result);
+ }
+ resolve(result);
}
- if (callback) { callback(result); }
- resolve(result);
- });
+ );
}
if (_darwin) {
@@ -464,7 +498,7 @@ function memLayout(callback) {
serialNum: util.getValue(lines, ' Serial Number:'),
voltageConfigured: null,
voltageMin: null,
- voltageMax: null,
+ voltageMax: null
});
} else {
result.push({
@@ -479,7 +513,7 @@ function memLayout(callback) {
serialNum: '',
voltageConfigured: null,
voltageMin: null,
- voltageMax: null,
+ voltageMax: null
});
}
});
@@ -502,59 +536,73 @@ function memLayout(callback) {
serialNum: '',
voltageConfigured: null,
voltageMin: null,
- voltageMax: null,
+ voltageMax: null
});
-
}
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
}
if (_sunos) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
if (_windows) {
// https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0a.pdf
- const memoryTypes = 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5'.split('|');
+ const memoryTypes =
+ 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5'.split(
+ '|'
+ );
const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
try {
- util.powerShell('Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl').then((stdout, error) => {
- if (!error) {
- let devices = stdout.toString().split(/\n\s*\n/);
- devices.shift();
- devices.forEach(function (device) {
- let lines = device.split('\r\n');
- const dataWidth = util.toInt(util.getValue(lines, 'DataWidth', ':'));
- const totalWidth = util.toInt(util.getValue(lines, 'TotalWidth', ':'));
- const size = parseInt(util.getValue(lines, 'Capacity', ':'), 10) || 0;
- const tag = util.getValue(lines, 'Tag', ':');
- const tagInt = util.splitByNumber(tag);
- if (size) {
- result.push({
- size,
- bank: util.getValue(lines, 'BankLabel', ':') + (tagInt[1] ? '/' + tagInt[1] : ''), // BankLabel
- type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', ':'), 10) || parseInt(util.getValue(lines, 'SMBIOSMemoryType', ':'), 10)],
- ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
- clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', ':'), 10) || parseInt(util.getValue(lines, 'Speed', ':'), 10) || 0,
- formFactor: FormFactors[parseInt(util.getValue(lines, 'FormFactor', ':'), 10) || 0],
- manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer', ':')),
- partNum: util.getValue(lines, 'PartNumber', ':'),
- serialNum: util.getValue(lines, 'SerialNumber', ':'),
- voltageConfigured: (parseInt(util.getValue(lines, 'ConfiguredVoltage', ':'), 10) || 0) / 1000.0,
- voltageMin: (parseInt(util.getValue(lines, 'MinVoltage', ':'), 10) || 0) / 1000.0,
- voltageMax: (parseInt(util.getValue(lines, 'MaxVoltage', ':'), 10) || 0) / 1000.0,
- });
- }
- });
- }
- if (callback) { callback(result); }
- resolve(result);
- });
+ util
+ .powerShell(
+ 'Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl'
+ )
+ .then((stdout, error) => {
+ if (!error) {
+ let devices = stdout.toString().split(/\n\s*\n/);
+ devices.shift();
+ devices.forEach(function (device) {
+ let lines = device.split('\r\n');
+ const dataWidth = util.toInt(util.getValue(lines, 'DataWidth', ':'));
+ const totalWidth = util.toInt(util.getValue(lines, 'TotalWidth', ':'));
+ const size = parseInt(util.getValue(lines, 'Capacity', ':'), 10) || 0;
+ const tag = util.getValue(lines, 'Tag', ':');
+ const tagInt = util.splitByNumber(tag);
+ if (size) {
+ result.push({
+ size,
+ bank: util.getValue(lines, 'BankLabel', ':') + (tagInt[1] ? '/' + tagInt[1] : ''), // BankLabel
+ type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', ':'), 10) || parseInt(util.getValue(lines, 'SMBIOSMemoryType', ':'), 10)],
+ ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
+ clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', ':'), 10) || parseInt(util.getValue(lines, 'Speed', ':'), 10) || 0,
+ formFactor: FormFactors[parseInt(util.getValue(lines, 'FormFactor', ':'), 10) || 0],
+ manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer', ':')),
+ partNum: util.getValue(lines, 'PartNumber', ':'),
+ serialNum: util.getValue(lines, 'SerialNumber', ':'),
+ voltageConfigured: (parseInt(util.getValue(lines, 'ConfiguredVoltage', ':'), 10) || 0) / 1000.0,
+ voltageMin: (parseInt(util.getValue(lines, 'MinVoltage', ':'), 10) || 0) / 1000.0,
+ voltageMax: (parseInt(util.getValue(lines, 'MaxVoltage', ':'), 10) || 0) / 1000.0
+ });
+ }
+ });
+ }
+ if (callback) {
+ callback(result);
+ }
+ resolve(result);
+ });
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
@@ -563,4 +611,3 @@ function memLayout(callback) {
}
exports.memLayout = memLayout;
-
diff --git a/lib/network.js b/lib/network.js
index e885c8e..0886e7c 100644
--- a/lib/network.js
+++ b/lib/network.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/osinfo.js b/lib/osinfo.js
index 59b47ba..978f017 100644
--- a/lib/osinfo.js
+++ b/lib/osinfo.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/printer.js b/lib/printer.js
index c7eab2d..b48c8b6 100644
--- a/lib/printer.js
+++ b/lib/printer.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -18,13 +18,13 @@ const util = require('./util');
let _platform = process.platform;
-const _linux = (_platform === 'linux' || _platform === 'android');
-const _darwin = (_platform === 'darwin');
-const _windows = (_platform === 'win32');
-const _freebsd = (_platform === 'freebsd');
-const _openbsd = (_platform === 'openbsd');
-const _netbsd = (_platform === 'netbsd');
-const _sunos = (_platform === 'sunos');
+const _linux = _platform === 'linux' || _platform === 'android';
+const _darwin = _platform === 'darwin';
+const _windows = _platform === 'win32';
+const _freebsd = _platform === 'freebsd';
+const _openbsd = _platform === 'openbsd';
+const _netbsd = _platform === 'netbsd';
+const _sunos = _platform === 'sunos';
const winPrinterStatus = {
1: 'Other',
@@ -33,7 +33,7 @@ const winPrinterStatus = {
4: 'Printing',
5: 'Warmup',
6: 'Stopped Printing',
- 7: 'Offline',
+ 7: 'Offline'
};
function parseLinuxCupsHeader(lines) {
@@ -70,7 +70,7 @@ function parseLinuxLpstatPrinter(lines, id) {
result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';
result.uri = null;
result.uuid = null;
- result.status = lines.length > 0 && lines[0] ? (lines[0].indexOf(' idle') > 0 ? 'idle' : (lines[0].indexOf(' printing') > 0 ? 'printing' : 'unknown')) : null;
+ result.status = lines.length > 0 && lines[0] ? (lines[0].indexOf(' idle') > 0 ? 'idle' : lines[0].indexOf(' printing') > 0 ? 'printing' : 'unknown') : null;
result.local = util.getValue(lines, 'Location', ':', true).toLowerCase().startsWith('local');
result.default = null;
result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');
@@ -112,7 +112,6 @@ function parseWindowsPrinters(lines, id) {
}
function printer(callback) {
-
return new Promise((resolve) => {
process.nextTick(() => {
let result = [];
diff --git a/lib/processes.js b/lib/processes.js
index 2a321ca..772cea1 100644
--- a/lib/processes.js
+++ b/lib/processes.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/system.js b/lib/system.js
index ba7e01b..631ed49 100644
--- a/lib/system.js
+++ b/lib/system.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -250,7 +250,7 @@ function system(callback) {
});
}
if (_darwin) {
- exec('ioreg -c IOPlatformExpertDevice -d 2', (error, stdout) => {
+ exec('ioreg -c IOPlatformExpertDevice -d 2', (error, stdout) => {
if (!error) {
const lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
diff --git a/lib/usb.js b/lib/usb.js
index 2504d1a..19ef80d 100644
--- a/lib/usb.js
+++ b/lib/usb.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -18,26 +18,36 @@ const util = require('./util');
let _platform = process.platform;
-const _linux = (_platform === 'linux' || _platform === 'android');
-const _darwin = (_platform === 'darwin');
-const _windows = (_platform === 'win32');
-const _freebsd = (_platform === 'freebsd');
-const _openbsd = (_platform === 'openbsd');
-const _netbsd = (_platform === 'netbsd');
-const _sunos = (_platform === 'sunos');
+const _linux = _platform === 'linux' || _platform === 'android';
+const _darwin = _platform === 'darwin';
+const _windows = _platform === 'win32';
+const _freebsd = _platform === 'freebsd';
+const _openbsd = _platform === 'openbsd';
+const _netbsd = _platform === 'netbsd';
+const _sunos = _platform === 'sunos';
function getLinuxUsbType(type, name) {
let result = type;
const str = (name + ' ' + type).toLowerCase();
- if (str.indexOf('camera') >= 0) { result = 'Camera'; }
- else if (str.indexOf('hub') >= 0) { result = 'Hub'; }
- else if (str.indexOf('keybrd') >= 0) { result = 'Keyboard'; }
- else if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
- else if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }
- else if (str.indexOf('stora') >= 0) { result = 'Storage'; }
- else if (str.indexOf('microp') >= 0) { result = 'Microphone'; }
- else if (str.indexOf('headset') >= 0) { result = 'Audio'; }
- else if (str.indexOf('audio') >= 0) { result = 'Audio'; }
+ if (str.indexOf('camera') >= 0) {
+ result = 'Camera';
+ } else if (str.indexOf('hub') >= 0) {
+ result = 'Hub';
+ } else if (str.indexOf('keybrd') >= 0) {
+ result = 'Keyboard';
+ } else if (str.indexOf('keyboard') >= 0) {
+ result = 'Keyboard';
+ } else if (str.indexOf('mouse') >= 0) {
+ result = 'Mouse';
+ } else if (str.indexOf('stora') >= 0) {
+ result = 'Storage';
+ } else if (str.indexOf('microp') >= 0) {
+ result = 'Microphone';
+ } else if (str.indexOf('headset') >= 0) {
+ result = 'Audio';
+ } else if (str.indexOf('audio') >= 0) {
+ result = 'Audio';
+ }
return result;
}
@@ -96,21 +106,37 @@ function parseLinuxUsb(usb) {
function getDarwinUsbType(name) {
let result = '';
- if (name.indexOf('camera') >= 0) { result = 'Camera'; }
- else if (name.indexOf('touch bar') >= 0) { result = 'Touch Bar'; }
- else if (name.indexOf('controller') >= 0) { result = 'Controller'; }
- else if (name.indexOf('headset') >= 0) { result = 'Audio'; }
- else if (name.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
- else if (name.indexOf('trackpad') >= 0) { result = 'Trackpad'; }
- else if (name.indexOf('sensor') >= 0) { result = 'Sensor'; }
- else if (name.indexOf('bthusb') >= 0) { result = 'Bluetooth'; }
- else if (name.indexOf('bth') >= 0) { result = 'Bluetooth'; }
- else if (name.indexOf('rfcomm') >= 0) { result = 'Bluetooth'; }
- else if (name.indexOf('usbhub') >= 0) { result = 'Hub'; }
- else if (name.indexOf(' hub') >= 0) { result = 'Hub'; }
- else if (name.indexOf('mouse') >= 0) { result = 'Mouse'; }
- else if (name.indexOf('microp') >= 0) { result = 'Microphone'; }
- else if (name.indexOf('removable') >= 0) { result = 'Storage'; }
+ if (name.indexOf('camera') >= 0) {
+ result = 'Camera';
+ } else if (name.indexOf('touch bar') >= 0) {
+ result = 'Touch Bar';
+ } else if (name.indexOf('controller') >= 0) {
+ result = 'Controller';
+ } else if (name.indexOf('headset') >= 0) {
+ result = 'Audio';
+ } else if (name.indexOf('keyboard') >= 0) {
+ result = 'Keyboard';
+ } else if (name.indexOf('trackpad') >= 0) {
+ result = 'Trackpad';
+ } else if (name.indexOf('sensor') >= 0) {
+ result = 'Sensor';
+ } else if (name.indexOf('bthusb') >= 0) {
+ result = 'Bluetooth';
+ } else if (name.indexOf('bth') >= 0) {
+ result = 'Bluetooth';
+ } else if (name.indexOf('rfcomm') >= 0) {
+ result = 'Bluetooth';
+ } else if (name.indexOf('usbhub') >= 0) {
+ result = 'Hub';
+ } else if (name.indexOf(' hub') >= 0) {
+ result = 'Hub';
+ } else if (name.indexOf('mouse') >= 0) {
+ result = 'Mouse';
+ } else if (name.indexOf('microp') >= 0) {
+ result = 'Microphone';
+ } else if (name.indexOf('removable') >= 0) {
+ result = 'Storage';
+ }
return result;
}
@@ -174,15 +200,25 @@ function parseDarwinUsb(usb, id) {
function getWindowsUsbTypeCreation(creationclass, name) {
let result = '';
- if (name.indexOf('storage') >= 0) { result = 'Storage'; }
- else if (name.indexOf('speicher') >= 0) { result = 'Storage'; }
- else if (creationclass.indexOf('usbhub') >= 0) { result = 'Hub'; }
- else if (creationclass.indexOf('storage') >= 0) { result = 'Storage'; }
- else if (creationclass.indexOf('usbcontroller') >= 0) { result = 'Controller'; }
- else if (creationclass.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
- else if (creationclass.indexOf('pointing') >= 0) { result = 'Mouse'; }
- else if (creationclass.indexOf('microp') >= 0) { result = 'Microphone'; }
- else if (creationclass.indexOf('disk') >= 0) { result = 'Storage'; }
+ if (name.indexOf('storage') >= 0) {
+ result = 'Storage';
+ } else if (name.indexOf('speicher') >= 0) {
+ result = 'Storage';
+ } else if (creationclass.indexOf('usbhub') >= 0) {
+ result = 'Hub';
+ } else if (creationclass.indexOf('storage') >= 0) {
+ result = 'Storage';
+ } else if (creationclass.indexOf('usbcontroller') >= 0) {
+ result = 'Controller';
+ } else if (creationclass.indexOf('keyboard') >= 0) {
+ result = 'Keyboard';
+ } else if (creationclass.indexOf('pointing') >= 0) {
+ result = 'Mouse';
+ } else if (creationclass.indexOf('microp') >= 0) {
+ result = 'Microphone';
+ } else if (creationclass.indexOf('disk') >= 0) {
+ result = 'Storage';
+ }
return result;
}
@@ -209,7 +245,6 @@ function parseWindowsUsb(lines, id) {
}
function usb(callback) {
-
return new Promise((resolve) => {
process.nextTick(() => {
let result = [];
@@ -233,7 +268,7 @@ function usb(callback) {
let cmd = 'ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l';
exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {
if (!error) {
- const parts = (stdout.toString()).split(' +-o ');
+ const parts = stdout.toString().split(' +-o ');
for (let i = 1; i < parts.length; i++) {
const usb = parseDarwinUsb(parts[i]);
if (usb) {
@@ -257,7 +292,7 @@ function usb(callback) {
const parts = stdout.toString().split(/\n\s*\n/);
for (let i = 0; i < parts.length; i++) {
const usb = parseWindowsUsb(parts[i].split('\n'), i);
- if (usb && result.filter(x => x.deviceId === usb.deviceId).length === 0) {
+ if (usb && result.filter((x) => x.deviceId === usb.deviceId).length === 0) {
result.push(usb);
}
}
@@ -276,4 +311,3 @@ function usb(callback) {
}
exports.usb = usb;
-
diff --git a/lib/users.js b/lib/users.js
index 3140ea2..873bcec 100644
--- a/lib/users.js
+++ b/lib/users.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -18,13 +18,13 @@ const util = require('./util');
let _platform = process.platform;
-const _linux = (_platform === 'linux' || _platform === 'android');
-const _darwin = (_platform === 'darwin');
-const _windows = (_platform === 'win32');
-const _freebsd = (_platform === 'freebsd');
-const _openbsd = (_platform === 'openbsd');
-const _netbsd = (_platform === 'netbsd');
-const _sunos = (_platform === 'sunos');
+const _linux = _platform === 'linux' || _platform === 'android';
+const _darwin = _platform === 'darwin';
+const _windows = _platform === 'win32';
+const _freebsd = _platform === 'freebsd';
+const _openbsd = _platform === 'openbsd';
+const _netbsd = _platform === 'netbsd';
+const _sunos = _platform === 'sunos';
function parseUsersLinux(lines, phase) {
let result = [];
@@ -49,11 +49,12 @@ function parseUsersLinux(lines, phase) {
tty: l[1],
date: l[2],
time: l[3],
- ip: (l && l.length > 4) ? l[4].replace(/\(/g, '').replace(/\)/g, '') : ''
+ ip: l && l.length > 4 ? l[4].replace(/\(/g, '').replace(/\)/g, '') : ''
});
} else {
// w part
- if (w_first) { // header
+ if (w_first) {
+ // header
w_header = l;
w_header.forEach(function (item) {
w_pos.push(line.indexOf(item));
@@ -63,11 +64,15 @@ function parseUsersLinux(lines, phase) {
// split by w_pos
result_w.user = line.substring(w_pos[0], w_pos[1] - 1).trim();
result_w.tty = line.substring(w_pos[1], w_pos[2] - 1).trim();
- result_w.ip = line.substring(w_pos[2], w_pos[3] - 1).replace(/\(/g, '').replace(/\)/g, '').trim();
+ result_w.ip = line
+ .substring(w_pos[2], w_pos[3] - 1)
+ .replace(/\(/g, '')
+ .replace(/\)/g, '')
+ .trim();
result_w.command = line.substring(w_pos[7], 1000).trim();
// find corresponding 'who' line
who_line = result_who.filter(function (obj) {
- return (obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty);
+ return obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty;
});
if (who_line.length === 1) {
result.push({
@@ -105,10 +110,10 @@ function parseUsersDarwin(lines) {
// who part
if (is_whopart) {
- let dt = ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
+ let dt = '' + new Date().getFullYear() + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
try {
- if (new Date(dt) > new Date) {
- dt = ('' + (new Date().getFullYear() - 1)) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
+ if (new Date(dt) > new Date()) {
+ dt = '' + (new Date().getFullYear() - 1) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
}
} catch {
util.noop();
@@ -117,18 +122,18 @@ function parseUsersDarwin(lines) {
user: l[0],
tty: l[1],
date: dt,
- time: l[4],
+ time: l[4]
});
} else {
// w part
// split by w_pos
result_w.user = l[0];
result_w.tty = l[1];
- result_w.ip = (l[2] !== '-') ? l[2] : '';
+ result_w.ip = l[2] !== '-' ? l[2] : '';
result_w.command = l.slice(5, 1000).join(' ');
// find corresponding 'who' line
who_line = result_who.filter(function (obj) {
- return (obj.user.substring(0, 10) === result_w.user.substring(0, 10) && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty));
+ return obj.user.substring(0, 10) === result_w.user.substring(0, 10) && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty);
});
if (who_line.length === 1) {
result.push({
@@ -147,7 +152,6 @@ function parseUsersDarwin(lines) {
}
function users(callback) {
-
return new Promise((resolve) => {
process.nextTick(() => {
let result = [];
@@ -166,15 +170,21 @@ function users(callback) {
lines = stdout.toString().split('\n');
result = parseUsersLinux(lines, 2);
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
} else {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
@@ -186,7 +196,9 @@ function users(callback) {
let lines = stdout.toString().split('\n');
result = parseUsersDarwin(lines);
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
}
@@ -197,7 +209,9 @@ function users(callback) {
let lines = stdout.toString().split('\n');
result = parseUsersDarwin(lines);
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
}
@@ -209,15 +223,18 @@ function users(callback) {
let lines = stdout.toString().split('\n');
result = parseUsersDarwin(lines);
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
}
if (_windows) {
try {
- let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl' + '; echo \'#-#-#-#\';';
- cmd += 'Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \'#-#-#-#\';';
- cmd += '$process = (Get-CimInstance Win32_Process -Filter "name = \'explorer.exe\'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo \'#-#-#-#\';';
+ let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl' + "; echo '#-#-#-#';";
+ cmd += 'Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ' + "; echo '#-#-#-#';";
+ cmd +=
+ "$process = (Get-CimInstance Win32_Process -Filter \"name = 'explorer.exe'\"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';";
cmd += 'query user';
util.powerShell(cmd).then((data) => {
if (data) {
@@ -231,7 +248,7 @@ function users(callback) {
loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
}
}
- users.forEach(user => {
+ users.forEach((user) => {
let dateTime = '';
for (let id in loggedons) {
if ({}.hasOwnProperty.call(loggedons, id)) {
@@ -251,12 +268,15 @@ function users(callback) {
});
});
}
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
-
});
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
}
@@ -266,7 +286,7 @@ function users(callback) {
function parseWinSessions(sessionParts) {
const sessions = {};
- sessionParts.forEach(session => {
+ sessionParts.forEach((session) => {
const lines = session.split('\r\n');
const id = util.getValue(lines, 'LogonId');
const starttime = util.getValue(lines, 'starttime');
@@ -282,19 +302,23 @@ function fuzzyMatch(name1, name2) {
name2 = name2.toLowerCase();
let eq = 0;
let len = name1.length;
- if (name2.length > len) { len = name2.length; }
+ if (name2.length > len) {
+ len = name2.length;
+ }
for (let i = 0; i < len; i++) {
const c1 = name1[i] || '';
const c2 = name2[i] || '';
- if (c1 === c2) { eq++; }
+ if (c1 === c2) {
+ eq++;
+ }
}
- return (len > 10 ? eq / len > 0.9 : (len > 0 ? eq / len > 0.8 : false));
+ return len > 10 ? eq / len > 0.9 : len > 0 ? eq / len > 0.8 : false;
}
function parseWinUsers(userParts, userQuery) {
const users = [];
- userParts.forEach(user => {
+ userParts.forEach((user) => {
const lines = user.split('\r\n');
const domain = util.getValue(lines, 'domain', ':', true);
@@ -302,7 +326,7 @@ function parseWinUsers(userParts, userQuery) {
const sessionid = util.getValue(lines, 'sessionid', ':', true);
if (username) {
- const quser = userQuery.filter(item => fuzzyMatch(item.user, username));
+ const quser = userQuery.filter((item) => fuzzyMatch(item.user, username));
users.push({
domain,
user: username,
@@ -315,7 +339,7 @@ function parseWinUsers(userParts, userQuery) {
function parseWinLoggedOn(loggedonParts) {
const loggedons = {};
- loggedonParts.forEach(loggedon => {
+ loggedonParts.forEach((loggedon) => {
const lines = loggedon.split('\r\n');
const antecendent = util.getValue(lines, 'antecedent', ':', true);
@@ -336,16 +360,16 @@ function parseWinLoggedOn(loggedonParts) {
}
function parseWinUsersQuery(lines) {
- lines = lines.filter(item => item);
+ lines = lines.filter((item) => item);
let result = [];
const header = lines[0];
const headerDelimiter = [];
if (header) {
- const start = (header[0] === ' ') ? 1 : 0;
+ const start = header[0] === ' ' ? 1 : 0;
headerDelimiter.push(start - 1);
let nextSpace = 0;
for (let i = start + 1; i < header.length; i++) {
- if (header[i] === ' ' && ((header[i - 1] === ' ') || (header[i - 1] === '.'))) {
+ if (header[i] === ' ' && (header[i - 1] === ' ' || header[i - 1] === '.')) {
nextSpace = i;
} else {
if (nextSpace) {
@@ -360,7 +384,7 @@ function parseWinUsersQuery(lines) {
const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || '';
result.push({
user: user,
- tty: tty,
+ tty: tty
});
}
}
diff --git a/lib/util.js b/lib/util.js
index 3784460..2f52ea6 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
diff --git a/lib/virtualbox.js b/lib/virtualbox.js
index 489b8db..0f5a787 100644
--- a/lib/virtualbox.js
+++ b/lib/virtualbox.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
@@ -18,7 +18,6 @@ const exec = require('child_process').exec;
const util = require('./util');
function vboxInfo(callback) {
-
// fallback - if only callback is given
let result = [];
return new Promise((resolve) => {
@@ -27,7 +26,7 @@ function vboxInfo(callback) {
exec(util.getVboxmanage() + ' list vms --long', function (error, stdout) {
let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');
parts.shift();
- parts.forEach(part => {
+ parts.forEach((part) => {
const lines = ('Name:' + part).split(os.EOL);
const state = util.getValue(lines, 'State');
const running = state.startsWith('running');
@@ -89,15 +88,19 @@ function vboxInfo(callback) {
bootDevice3: util.getValue(lines, 'Boot Device 3'),
bootDevice4: util.getValue(lines, 'Boot Device 4'),
timeOffset: util.getValue(lines, 'Time offset'),
- rtc: util.getValue(lines, 'RTC'),
+ rtc: util.getValue(lines, 'RTC')
});
});
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
});
} catch (e) {
- if (callback) { callback(result); }
+ if (callback) {
+ callback(result);
+ }
resolve(result);
}
});
diff --git a/lib/wifi.js b/lib/wifi.js
index 0c4c093..88bafb6 100644
--- a/lib/wifi.js
+++ b/lib/wifi.js
@@ -5,7 +5,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
-// Copyright: (c) 2014 - 2025
+// Copyright: (c) 2014 - 2026
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT