systeminformation 5.23.8 → 5.23.10
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/index.d.ts +8 -0
- package/lib/osinfo.js +19 -5
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -963,6 +963,7 @@ export function chassis(cb?: (data: Systeminformation.ChassisData) => any): Prom
|
|
|
963
963
|
export function time(): Systeminformation.TimeData;
|
|
964
964
|
export function osInfo(cb?: (data: Systeminformation.OsData) => any): Promise<Systeminformation.OsData>;
|
|
965
965
|
export function versions(apps?: string, cb?: (data: Systeminformation.VersionData) => any): Promise<Systeminformation.VersionData>;
|
|
966
|
+
export function versions(cb?: (data: Systeminformation.VersionData) => any): Promise<Systeminformation.VersionData>;
|
|
966
967
|
export function shell(cb?: (data: string) => any): Promise<string>;
|
|
967
968
|
export function uuid(cb?: (data: Systeminformation.UuidData) => any): Promise<Systeminformation.UuidData>;
|
|
968
969
|
|
|
@@ -981,6 +982,7 @@ export function battery(cb?: (data: Systeminformation.BatteryData) => any): Prom
|
|
|
981
982
|
export function graphics(cb?: (data: Systeminformation.GraphicsData) => any): Promise<Systeminformation.GraphicsData>;
|
|
982
983
|
|
|
983
984
|
export function fsSize(drive?: string, cb?: (data: Systeminformation.FsSizeData[]) => any): Promise<Systeminformation.FsSizeData[]>;
|
|
985
|
+
export function fsSize(cb?: (data: Systeminformation.FsSizeData[]) => any): Promise<Systeminformation.FsSizeData[]>;
|
|
984
986
|
export function fsOpenFiles(cb?: (data: Systeminformation.FsOpenFilesData[]) => any): Promise<Systeminformation.FsOpenFilesData[]>;
|
|
985
987
|
export function blockDevices(cb?: (data: Systeminformation.BlockDevicesData[]) => any): Promise<Systeminformation.BlockDevicesData[]>;
|
|
986
988
|
export function fsStats(cb?: (data: Systeminformation.FsStatsData) => any): Promise<Systeminformation.FsStatsData>;
|
|
@@ -999,9 +1001,11 @@ export function networkInterfaces(
|
|
|
999
1001
|
): Promise<Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData>;
|
|
1000
1002
|
|
|
1001
1003
|
export function networkStats(ifaces?: string, cb?: (data: Systeminformation.NetworkStatsData[]) => any): Promise<Systeminformation.NetworkStatsData[]>;
|
|
1004
|
+
export function networkStats(cb?: (data: Systeminformation.NetworkStatsData[]) => any): Promise<Systeminformation.NetworkStatsData[]>;
|
|
1002
1005
|
export function networkConnections(cb?: (data: Systeminformation.NetworkConnectionsData[]) => any): Promise<Systeminformation.NetworkConnectionsData[]>;
|
|
1003
1006
|
export function inetChecksite(url: string, cb?: (data: Systeminformation.InetChecksiteData) => any): Promise<Systeminformation.InetChecksiteData>;
|
|
1004
1007
|
export function inetLatency(host?: string, cb?: (data: number) => any): Promise<number>;
|
|
1008
|
+
export function inetLatency(cb?: (data: number) => any): Promise<number>;
|
|
1005
1009
|
|
|
1006
1010
|
export function wifiNetworks(cb?: (data: Systeminformation.WifiNetworkData[]) => any): Promise<Systeminformation.WifiNetworkData[]>;
|
|
1007
1011
|
export function wifiInterfaces(cb?: (data: Systeminformation.WifiInterfaceData[]) => any): Promise<Systeminformation.WifiInterfaceData[]>;
|
|
@@ -1015,9 +1019,13 @@ export function services(serviceName: string, cb?: (data: Systeminformation.Serv
|
|
|
1015
1019
|
|
|
1016
1020
|
export function dockerInfo(cb?: (data: Systeminformation.DockerInfoData) => any): Promise<Systeminformation.DockerInfoData>;
|
|
1017
1021
|
export function dockerImages(all?: boolean, cb?: (data: Systeminformation.DockerImageData[]) => any): Promise<Systeminformation.DockerImageData[]>;
|
|
1022
|
+
export function dockerImages(cb?: (data: Systeminformation.DockerImageData[]) => any): Promise<Systeminformation.DockerImageData[]>;
|
|
1018
1023
|
export function dockerContainers(all?: boolean, cb?: (data: Systeminformation.DockerContainerData[]) => any): Promise<Systeminformation.DockerContainerData[]>;
|
|
1024
|
+
export function dockerContainers(cb?: (data: Systeminformation.DockerContainerData[]) => any): Promise<Systeminformation.DockerContainerData[]>;
|
|
1019
1025
|
export function dockerContainerStats(id?: string, cb?: (data: Systeminformation.DockerContainerStatsData[]) => any): Promise<Systeminformation.DockerContainerStatsData[]>;
|
|
1026
|
+
export function dockerContainerStats(cb?: (data: Systeminformation.DockerContainerStatsData[]) => any): Promise<Systeminformation.DockerContainerStatsData[]>;
|
|
1020
1027
|
export function dockerContainerProcesses(id?: string, cb?: (data: any) => any): Promise<Systeminformation.DockerContainerProcessData[]>;
|
|
1028
|
+
export function dockerContainerProcesses(cb?: (data: any) => any): Promise<Systeminformation.DockerContainerProcessData[]>;
|
|
1021
1029
|
export function dockerVolumes(cb?: (data: Systeminformation.DockerVolumeData[]) => any): Promise<Systeminformation.DockerVolumeData[]>;
|
|
1022
1030
|
export function dockerAll(cb?: (data: any) => any): Promise<any>;
|
|
1023
1031
|
|
package/lib/osinfo.js
CHANGED
|
@@ -34,11 +34,25 @@ const _sunos = (_platform === 'sunos');
|
|
|
34
34
|
|
|
35
35
|
function time() {
|
|
36
36
|
let t = new Date().toString().split(' ');
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
if (_darwin || _linux) {
|
|
38
|
+
const stdout = execSync('date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null', util.execOptsLinux);
|
|
39
|
+
const lines = stdout.toString().split(os.EOL);
|
|
40
|
+
if (lines.length > 3 && !lines[0]) {
|
|
41
|
+
lines.shift();
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
current: Date.now(),
|
|
45
|
+
uptime: os.uptime(),
|
|
46
|
+
timezone: lines[0] && lines[1] ? lines[0] + lines[1] : '',
|
|
47
|
+
timezoneName: lines[2] && lines[2].indexOf('/zoneinfo/') > 0 ? (lines[2].split('/zoneinfo/')[1] || '') : ''
|
|
48
|
+
};
|
|
49
|
+
} else {
|
|
50
|
+
return {
|
|
51
|
+
current: Date.now(),
|
|
52
|
+
uptime: os.uptime(),
|
|
53
|
+
timezone: (t.length >= 7) ? t[5] : '',
|
|
54
|
+
timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
|
|
55
|
+
};
|
|
42
56
|
};
|
|
43
57
|
}
|
|
44
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.23.
|
|
3
|
+
"version": "5.23.10",
|
|
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)",
|