systeminformation 5.33.3 → 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +873 -957
- package/dist/audio.d.ts +1 -0
- package/dist/audio.js +18 -0
- package/dist/baseboard.d.ts +1 -0
- package/dist/baseboard.js +17 -0
- package/dist/battery.d.ts +1 -0
- package/dist/battery.js +19 -0
- package/dist/bios.d.ts +1 -0
- package/dist/bios.js +17 -0
- package/dist/block-devices.d.ts +1 -0
- package/dist/block-devices.js +17 -0
- package/dist/bluetooth.d.ts +1 -0
- package/dist/bluetooth.js +17 -0
- package/dist/bsd/battery.d.ts +2 -0
- package/dist/bsd/battery.js +27 -0
- package/dist/bsd/cpu-cache.d.ts +1 -0
- package/dist/bsd/cpu-cache.js +37 -0
- package/dist/bsd/cpu-flags.d.ts +1 -0
- package/dist/bsd/cpu-flags.js +28 -0
- package/dist/bsd/cpu-temperature.d.ts +1 -0
- package/dist/bsd/cpu-temperature.js +29 -0
- package/dist/bsd/cpu.d.ts +1 -0
- package/dist/bsd/cpu.js +98 -0
- package/dist/bsd/index.d.ts +38 -0
- package/dist/bsd/index.js +85 -0
- package/dist/bsd/mem.d.ts +1 -0
- package/dist/bsd/mem.js +37 -0
- package/dist/bsd/network-stats.d.ts +2 -0
- package/dist/bsd/network-stats.js +92 -0
- package/dist/bsd/os-info.d.ts +21 -0
- package/dist/bsd/os-info.js +38 -0
- package/dist/bsd/uuid.d.ts +2 -0
- package/dist/bsd/uuid.js +30 -0
- package/dist/camera.d.ts +1 -0
- package/dist/camera.js +17 -0
- package/dist/chassis.d.ts +1 -0
- package/dist/chassis.js +17 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +107 -0
- package/dist/common/codepage.d.ts +1 -0
- package/dist/common/codepage.js +43 -0
- package/dist/common/const.d.ts +25 -0
- package/dist/common/const.js +26 -0
- package/dist/common/cpu.d.ts +2 -0
- package/dist/common/cpu.js +12 -0
- package/dist/common/darwin.d.ts +6 -0
- package/dist/common/darwin.js +266 -0
- package/dist/common/datetime.d.ts +9 -0
- package/dist/common/datetime.js +161 -0
- package/dist/common/defaults.d.ts +25 -0
- package/dist/common/defaults.js +299 -0
- package/dist/common/exec.d.ts +10 -0
- package/dist/common/exec.js +69 -0
- package/dist/common/files.d.ts +2 -0
- package/dist/common/files.js +39 -0
- package/dist/common/filesys.d.ts +11 -0
- package/dist/common/filesys.js +282 -0
- package/dist/common/host.d.ts +2 -0
- package/dist/common/host.js +67 -0
- package/dist/common/index.d.ts +12 -0
- package/dist/common/index.js +146 -0
- package/dist/common/internet.d.ts +1 -0
- package/dist/common/internet.js +47 -0
- package/dist/common/mappings.d.ts +55 -0
- package/dist/common/mappings.js +4133 -0
- package/dist/common/network.d.ts +8 -0
- package/dist/common/network.js +162 -0
- package/dist/common/nvidia.d.ts +22 -0
- package/dist/common/nvidia.js +159 -0
- package/dist/common/parse.d.ts +13 -0
- package/dist/common/parse.js +157 -0
- package/dist/common/raspberry.d.ts +5 -0
- package/dist/common/raspberry.js +277 -0
- package/dist/common/security.d.ts +31 -0
- package/dist/common/security.js +241 -0
- package/dist/common/types.d.ts +992 -0
- package/dist/common/types.js +2 -0
- package/dist/common/windows.d.ts +58 -0
- package/dist/common/windows.js +292 -0
- package/dist/cpu-cache.d.ts +1 -0
- package/dist/cpu-cache.js +19 -0
- package/dist/cpu-current-load.d.ts +2 -0
- package/dist/cpu-current-load.js +249 -0
- package/dist/cpu-current-speed.d.ts +3 -0
- package/dist/cpu-current-speed.js +84 -0
- package/dist/cpu-flags.d.ts +1 -0
- package/dist/cpu-flags.js +19 -0
- package/dist/cpu-full-load.d.ts +1 -0
- package/dist/cpu-full-load.js +30 -0
- package/dist/cpu-temperature.d.ts +1 -0
- package/dist/cpu-temperature.js +19 -0
- package/dist/cpu.d.ts +1 -0
- package/dist/cpu.js +19 -0
- package/dist/darwin/audio.d.ts +2 -0
- package/dist/darwin/audio.js +46 -0
- package/dist/darwin/baseboard.d.ts +1 -0
- package/dist/darwin/baseboard.js +48 -0
- package/dist/darwin/battery.d.ts +2 -0
- package/dist/darwin/battery.js +65 -0
- package/dist/darwin/bios.d.ts +1 -0
- package/dist/darwin/bios.js +45 -0
- package/dist/darwin/block-devices.d.ts +2 -0
- package/dist/darwin/block-devices.js +101 -0
- package/dist/darwin/bluetooth.d.ts +3 -0
- package/dist/darwin/bluetooth.js +84 -0
- package/dist/darwin/camera.d.ts +2 -0
- package/dist/darwin/camera.js +55 -0
- package/dist/darwin/chassis.d.ts +2 -0
- package/dist/darwin/chassis.js +32 -0
- package/dist/darwin/cpu-cache.d.ts +2 -0
- package/dist/darwin/cpu-cache.js +29 -0
- package/dist/darwin/cpu-flags.d.ts +1 -0
- package/dist/darwin/cpu-flags.js +16 -0
- package/dist/darwin/cpu-temperature.d.ts +1 -0
- package/dist/darwin/cpu-temperature.js +44 -0
- package/dist/darwin/cpu.d.ts +1 -0
- package/dist/darwin/cpu.js +69 -0
- package/dist/darwin/disk-layout.d.ts +2 -0
- package/dist/darwin/disk-layout.js +231 -0
- package/dist/darwin/disks-io.d.ts +2 -0
- package/dist/darwin/disks-io.js +56 -0
- package/dist/darwin/displays.d.ts +2 -0
- package/dist/darwin/displays.js +98 -0
- package/dist/darwin/fs-open-files.d.ts +2 -0
- package/dist/darwin/fs-open-files.js +27 -0
- package/dist/darwin/fs-stats.d.ts +2 -0
- package/dist/darwin/fs-stats.js +47 -0
- package/dist/darwin/gpu.d.ts +2 -0
- package/dist/darwin/gpu.js +55 -0
- package/dist/darwin/index.d.ts +56 -0
- package/dist/darwin/index.js +122 -0
- package/dist/darwin/keyboard.d.ts +2 -0
- package/dist/darwin/keyboard.js +73 -0
- package/dist/darwin/mem-layout.d.ts +2 -0
- package/dist/darwin/mem-layout.js +60 -0
- package/dist/darwin/mem.d.ts +2 -0
- package/dist/darwin/mem.js +50 -0
- package/dist/darwin/mouse.d.ts +2 -0
- package/dist/darwin/mouse.js +78 -0
- package/dist/darwin/network-connections.d.ts +2 -0
- package/dist/darwin/network-connections.js +98 -0
- package/dist/darwin/network-gateway-default.d.ts +1 -0
- package/dist/darwin/network-gateway-default.js +26 -0
- package/dist/darwin/network-interface-default.d.ts +2 -0
- package/dist/darwin/network-interface-default.js +41 -0
- package/dist/darwin/network-interfaces.d.ts +2 -0
- package/dist/darwin/network-interfaces.js +205 -0
- package/dist/darwin/network-stats.d.ts +2 -0
- package/dist/darwin/network-stats.js +86 -0
- package/dist/darwin/npm.d.ts +1 -0
- package/dist/darwin/npm.js +5 -0
- package/dist/darwin/npu.d.ts +2 -0
- package/dist/darwin/npu.js +41 -0
- package/dist/darwin/os-info.d.ts +1 -0
- package/dist/darwin/os-info.js +110 -0
- package/dist/darwin/pci.d.ts +2 -0
- package/dist/darwin/pci.js +37 -0
- package/dist/darwin/printer.d.ts +2 -0
- package/dist/darwin/printer.js +45 -0
- package/dist/darwin/software.d.ts +2 -0
- package/dist/darwin/software.js +39 -0
- package/dist/darwin/system.d.ts +1 -0
- package/dist/darwin/system.js +29 -0
- package/dist/darwin/thunderbolt.d.ts +1 -0
- package/dist/darwin/thunderbolt.js +53 -0
- package/dist/darwin/usb.d.ts +3 -0
- package/dist/darwin/usb.js +69 -0
- package/dist/darwin/users.d.ts +2 -0
- package/dist/darwin/users.js +13 -0
- package/dist/darwin/uuid.d.ts +2 -0
- package/dist/darwin/uuid.js +39 -0
- package/dist/darwin/wifi-connections.d.ts +2 -0
- package/dist/darwin/wifi-connections.js +60 -0
- package/dist/darwin/wifi-interfaces.d.ts +2 -0
- package/dist/darwin/wifi-interfaces.js +27 -0
- package/dist/darwin/wifi-networks.d.ts +2 -0
- package/dist/darwin/wifi-networks.js +61 -0
- package/dist/disk-layout.d.ts +1 -0
- package/dist/disk-layout.js +17 -0
- package/dist/disks-io.d.ts +1 -0
- package/dist/disks-io.js +17 -0
- package/dist/displays.d.ts +1 -0
- package/dist/displays.js +17 -0
- package/dist/docker-socket.d.ts +11 -0
- package/dist/docker-socket.js +113 -0
- package/dist/docker.d.ts +102 -0
- package/dist/docker.js +532 -0
- package/dist/fs-open-files.d.ts +1 -0
- package/dist/fs-open-files.js +17 -0
- package/dist/fs-size.d.ts +1 -0
- package/dist/fs-size.js +23 -0
- package/dist/fs-stats.d.ts +1 -0
- package/dist/fs-stats.js +17 -0
- package/dist/get-data.d.ts +110 -0
- package/dist/get-data.js +151 -0
- package/dist/get.d.ts +5 -0
- package/dist/get.js +117 -0
- package/dist/gpu.d.ts +1 -0
- package/dist/gpu.js +17 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +130 -0
- package/dist/inet-checksite.d.ts +1 -0
- package/dist/inet-checksite.js +11 -0
- package/dist/inet-latency.d.ts +1 -0
- package/dist/inet-latency.js +17 -0
- package/dist/keyboard.d.ts +1 -0
- package/dist/keyboard.js +17 -0
- package/dist/linux/audio.d.ts +2 -0
- package/dist/linux/audio.js +67 -0
- package/dist/linux/baseboard.d.ts +1 -0
- package/dist/linux/baseboard.js +81 -0
- package/dist/linux/battery.d.ts +2 -0
- package/dist/linux/battery.js +88 -0
- package/dist/linux/bios.d.ts +2 -0
- package/dist/linux/bios.js +55 -0
- package/dist/linux/block-devices.d.ts +2 -0
- package/dist/linux/block-devices.js +30 -0
- package/dist/linux/bluetooth.d.ts +2 -0
- package/dist/linux/bluetooth.js +86 -0
- package/dist/linux/camera.d.ts +2 -0
- package/dist/linux/camera.js +63 -0
- package/dist/linux/chassis.d.ts +1 -0
- package/dist/linux/chassis.js +41 -0
- package/dist/linux/cpu-cache.d.ts +1 -0
- package/dist/linux/cpu-cache.js +35 -0
- package/dist/linux/cpu-flags.d.ts +1 -0
- package/dist/linux/cpu-flags.js +33 -0
- package/dist/linux/cpu-temperature.d.ts +1 -0
- package/dist/linux/cpu-temperature.js +179 -0
- package/dist/linux/cpu.d.ts +1 -0
- package/dist/linux/cpu.js +135 -0
- package/dist/linux/disk-layout.d.ts +2 -0
- package/dist/linux/disk-layout.js +151 -0
- package/dist/linux/disks-io.d.ts +2 -0
- package/dist/linux/disks-io.js +58 -0
- package/dist/linux/displays.d.ts +2 -0
- package/dist/linux/displays.js +193 -0
- package/dist/linux/fs-open-files.d.ts +2 -0
- package/dist/linux/fs-open-files.js +44 -0
- package/dist/linux/fs-size.d.ts +2 -0
- package/dist/linux/fs-size.js +157 -0
- package/dist/linux/fs-stats.d.ts +2 -0
- package/dist/linux/fs-stats.js +65 -0
- package/dist/linux/gpu.d.ts +2 -0
- package/dist/linux/gpu.js +273 -0
- package/dist/linux/index.d.ts +56 -0
- package/dist/linux/index.js +122 -0
- package/dist/linux/inet-latency.d.ts +1 -0
- package/dist/linux/inet-latency.js +39 -0
- package/dist/linux/keyboard.d.ts +2 -0
- package/dist/linux/keyboard.js +61 -0
- package/dist/linux/mem-layout.d.ts +2 -0
- package/dist/linux/mem-layout.js +112 -0
- package/dist/linux/mem.d.ts +2 -0
- package/dist/linux/mem.js +61 -0
- package/dist/linux/mouse.d.ts +2 -0
- package/dist/linux/mouse.js +73 -0
- package/dist/linux/network-connections.d.ts +2 -0
- package/dist/linux/network-connections.js +114 -0
- package/dist/linux/network-gateway-default.d.ts +1 -0
- package/dist/linux/network-gateway-default.js +22 -0
- package/dist/linux/network-interface-default.d.ts +2 -0
- package/dist/linux/network-interface-default.js +46 -0
- package/dist/linux/network-interfaces.d.ts +3 -0
- package/dist/linux/network-interfaces.js +353 -0
- package/dist/linux/network-stats.d.ts +2 -0
- package/dist/linux/network-stats.js +99 -0
- package/dist/linux/npm.d.ts +1 -0
- package/dist/linux/npm.js +5 -0
- package/dist/linux/npu.d.ts +2 -0
- package/dist/linux/npu.js +77 -0
- package/dist/linux/os-info.d.ts +1 -0
- package/dist/linux/os-info.js +104 -0
- package/dist/linux/pci.d.ts +2 -0
- package/dist/linux/pci.js +56 -0
- package/dist/linux/printer.d.ts +2 -0
- package/dist/linux/printer.js +80 -0
- package/dist/linux/process-load.d.ts +2 -0
- package/dist/linux/process-load.js +164 -0
- package/dist/linux/processes.d.ts +2 -0
- package/dist/linux/processes.js +358 -0
- package/dist/linux/services.d.ts +2 -0
- package/dist/linux/services.js +222 -0
- package/dist/linux/software.d.ts +2 -0
- package/dist/linux/software.js +110 -0
- package/dist/linux/system.d.ts +1 -0
- package/dist/linux/system.js +186 -0
- package/dist/linux/thunderbolt.d.ts +2 -0
- package/dist/linux/thunderbolt.js +51 -0
- package/dist/linux/time.d.ts +6 -0
- package/dist/linux/time.js +28 -0
- package/dist/linux/usb.d.ts +2 -0
- package/dist/linux/usb.js +62 -0
- package/dist/linux/users.d.ts +2 -0
- package/dist/linux/users.js +102 -0
- package/dist/linux/uuid.d.ts +2 -0
- package/dist/linux/uuid.js +44 -0
- package/dist/linux/wifi-connections.d.ts +2 -0
- package/dist/linux/wifi-connections.js +196 -0
- package/dist/linux/wifi-interfaces.d.ts +2 -0
- package/dist/linux/wifi-interfaces.js +96 -0
- package/dist/linux/wifi-networks.d.ts +2 -0
- package/dist/linux/wifi-networks.js +176 -0
- package/dist/mem-layout.d.ts +1 -0
- package/dist/mem-layout.js +17 -0
- package/dist/mem.d.ts +1 -0
- package/dist/mem.js +19 -0
- package/dist/mouse.d.ts +1 -0
- package/dist/mouse.js +17 -0
- package/dist/network-connections.d.ts +1 -0
- package/dist/network-connections.js +17 -0
- package/dist/network-gateway-default.d.ts +1 -0
- package/dist/network-gateway-default.js +17 -0
- package/dist/network-interface-default.d.ts +1 -0
- package/dist/network-interface-default.js +17 -0
- package/dist/network-interfaces.d.ts +1 -0
- package/dist/network-interfaces.js +18 -0
- package/dist/network-stats.d.ts +1 -0
- package/dist/network-stats.js +19 -0
- package/dist/npm.d.ts +2 -0
- package/dist/npm.js +22 -0
- package/dist/npu.d.ts +1 -0
- package/dist/npu.js +17 -0
- package/dist/observe.d.ts +5 -0
- package/dist/observe.js +16 -0
- package/dist/os-info.d.ts +1 -0
- package/dist/os-info.js +21 -0
- package/dist/pci.d.ts +1 -0
- package/dist/pci.js +17 -0
- package/dist/printer.d.ts +1 -0
- package/dist/printer.js +17 -0
- package/dist/process-load.d.ts +1 -0
- package/dist/process-load.js +15 -0
- package/dist/processes.d.ts +1 -0
- package/dist/processes.js +15 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +15 -0
- package/dist/shell.d.ts +1 -0
- package/dist/shell.js +16 -0
- package/dist/software.d.ts +1 -0
- package/dist/software.js +17 -0
- package/dist/sun/index.d.ts +17 -0
- package/dist/sun/index.js +43 -0
- package/dist/sun/inet-latency.d.ts +1 -0
- package/dist/sun/inet-latency.js +30 -0
- package/dist/sun/os-info.d.ts +1 -0
- package/dist/sun/os-info.js +26 -0
- package/dist/sun/users.d.ts +2 -0
- package/dist/sun/users.js +13 -0
- package/dist/system.d.ts +1 -0
- package/dist/system.js +17 -0
- package/dist/thunderbolt.d.ts +1 -0
- package/dist/thunderbolt.js +17 -0
- package/dist/time.d.ts +6 -0
- package/dist/time.js +28 -0
- package/dist/usb.d.ts +1 -0
- package/dist/usb.js +17 -0
- package/dist/users.d.ts +1 -0
- package/dist/users.js +21 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +19 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +16 -0
- package/dist/versions.d.ts +2 -0
- package/dist/versions.js +1122 -0
- package/dist/virtualbox.d.ts +2 -0
- package/dist/virtualbox.js +89 -0
- package/dist/wifi-connections.d.ts +1 -0
- package/dist/wifi-connections.js +17 -0
- package/dist/wifi-interfaces.d.ts +1 -0
- package/dist/wifi-interfaces.js +17 -0
- package/dist/wifi-networks.d.ts +1 -0
- package/dist/wifi-networks.js +17 -0
- package/dist/windows/audio.d.ts +2 -0
- package/dist/windows/audio.js +23 -0
- package/dist/windows/baseboard.d.ts +1 -0
- package/dist/windows/baseboard.js +35 -0
- package/dist/windows/battery.d.ts +1 -0
- package/dist/windows/battery.js +81 -0
- package/dist/windows/bios.d.ts +1 -0
- package/dist/windows/bios.js +37 -0
- package/dist/windows/block-devices.d.ts +2 -0
- package/dist/windows/block-devices.js +48 -0
- package/dist/windows/bluetooth.d.ts +2 -0
- package/dist/windows/bluetooth.js +31 -0
- package/dist/windows/camera.d.ts +2 -0
- package/dist/windows/camera.js +47 -0
- package/dist/windows/chassis.d.ts +1 -0
- package/dist/windows/chassis.js +29 -0
- package/dist/windows/cpu-cache.d.ts +2 -0
- package/dist/windows/cpu-cache.js +59 -0
- package/dist/windows/cpu-flags.d.ts +1 -0
- package/dist/windows/cpu-flags.js +61 -0
- package/dist/windows/cpu-temperature.d.ts +1 -0
- package/dist/windows/cpu-temperature.js +32 -0
- package/dist/windows/cpu.d.ts +1 -0
- package/dist/windows/cpu.js +96 -0
- package/dist/windows/disk-layout.d.ts +2 -0
- package/dist/windows/disk-layout.js +112 -0
- package/dist/windows/disks-io.d.ts +2 -0
- package/dist/windows/disks-io.js +43 -0
- package/dist/windows/displays.d.ts +2 -0
- package/dist/windows/displays.js +213 -0
- package/dist/windows/fs-open-files.d.ts +2 -0
- package/dist/windows/fs-open-files.js +22 -0
- package/dist/windows/fs-size.d.ts +2 -0
- package/dist/windows/fs-size.js +47 -0
- package/dist/windows/fs-stats.d.ts +2 -0
- package/dist/windows/fs-stats.js +37 -0
- package/dist/windows/gpu.d.ts +2 -0
- package/dist/windows/gpu.js +128 -0
- package/dist/windows/index.d.ts +56 -0
- package/dist/windows/index.js +122 -0
- package/dist/windows/inet-latency.d.ts +1 -0
- package/dist/windows/inet-latency.js +34 -0
- package/dist/windows/keyboard.d.ts +2 -0
- package/dist/windows/keyboard.js +47 -0
- package/dist/windows/mem-layout.d.ts +2 -0
- package/dist/windows/mem-layout.js +39 -0
- package/dist/windows/mem.d.ts +2 -0
- package/dist/windows/mem.js +33 -0
- package/dist/windows/mouse.d.ts +2 -0
- package/dist/windows/mouse.js +64 -0
- package/dist/windows/network-connections.d.ts +2 -0
- package/dist/windows/network-connections.js +93 -0
- package/dist/windows/network-gateway-default.d.ts +1 -0
- package/dist/windows/network-gateway-default.js +36 -0
- package/dist/windows/network-interface-default.d.ts +2 -0
- package/dist/windows/network-interface-default.js +56 -0
- package/dist/windows/network-interfaces.d.ts +2 -0
- package/dist/windows/network-interfaces.js +346 -0
- package/dist/windows/network-stats.d.ts +2 -0
- package/dist/windows/network-stats.js +135 -0
- package/dist/windows/npm.d.ts +1 -0
- package/dist/windows/npm.js +5 -0
- package/dist/windows/npu.d.ts +2 -0
- package/dist/windows/npu.js +29 -0
- package/dist/windows/os-info.d.ts +1 -0
- package/dist/windows/os-info.js +65 -0
- package/dist/windows/pci.d.ts +2 -0
- package/dist/windows/pci.js +33 -0
- package/dist/windows/printer.d.ts +2 -0
- package/dist/windows/printer.js +36 -0
- package/dist/windows/process-load.d.ts +2 -0
- package/dist/windows/process-load.js +121 -0
- package/dist/windows/processes.d.ts +9 -0
- package/dist/windows/processes.js +139 -0
- package/dist/windows/services.d.ts +2 -0
- package/dist/windows/services.js +83 -0
- package/dist/windows/shell.d.ts +1 -0
- package/dist/windows/shell.js +19 -0
- package/dist/windows/software.d.ts +2 -0
- package/dist/windows/software.js +53 -0
- package/dist/windows/system.d.ts +1 -0
- package/dist/windows/system.js +98 -0
- package/dist/windows/thunderbolt.d.ts +2 -0
- package/dist/windows/thunderbolt.js +34 -0
- package/dist/windows/usb.d.ts +2 -0
- package/dist/windows/usb.js +37 -0
- package/dist/windows/users.d.ts +2 -0
- package/dist/windows/users.js +151 -0
- package/dist/windows/uuid.d.ts +2 -0
- package/dist/windows/uuid.js +28 -0
- package/dist/windows/wifi-connections.d.ts +2 -0
- package/dist/windows/wifi-connections.js +56 -0
- package/dist/windows/wifi-interfaces.d.ts +2 -0
- package/dist/windows/wifi-interfaces.js +45 -0
- package/dist/windows/wifi-networks.d.ts +2 -0
- package/dist/windows/wifi-networks.js +50 -0
- package/package.json +78 -12
- package/lib/audio.js +0 -277
- package/lib/battery.js +0 -334
- package/lib/bluetooth.js +0 -315
- package/lib/bluetoothVendors.js +0 -1138
- package/lib/cli.js +0 -100
- package/lib/cpu.js +0 -2285
- package/lib/docker.js +0 -791
- package/lib/dockerSocket.js +0 -117
- package/lib/filesystem.js +0 -1832
- package/lib/graphics.js +0 -1321
- package/lib/index.d.ts +0 -1051
- package/lib/index.js +0 -520
- package/lib/internet.js +0 -259
- package/lib/memory.js +0 -622
- package/lib/network.js +0 -2008
- package/lib/osinfo.js +0 -1321
- package/lib/printer.js +0 -209
- package/lib/processes.js +0 -1459
- package/lib/system.js +0 -855
- package/lib/usb.js +0 -309
- package/lib/users.js +0 -412
- package/lib/util.js +0 -2824
- package/lib/virtualbox.js +0 -116
- package/lib/wifi.js +0 -839
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchDevicesWin = exports.matchDevicesLinux = exports.raidMatchLinux = exports.parseLinuxBlk = exports.blkStdoutToObject = exports.calcDiskIO = exports._disk_io = exports.calcFsSpeed = exports._fs_speed = exports.smartMonToolsInstalled = void 0;
|
|
4
|
+
const index_1 = require("./index");
|
|
5
|
+
const const_1 = require("./const");
|
|
6
|
+
const defaults_1 = require("./defaults");
|
|
7
|
+
const exec_1 = require("./exec");
|
|
8
|
+
let _smartMonToolsInstalled = null;
|
|
9
|
+
const smartMonToolsInstalled = async () => {
|
|
10
|
+
if (_smartMonToolsInstalled !== null) {
|
|
11
|
+
return _smartMonToolsInstalled;
|
|
12
|
+
}
|
|
13
|
+
_smartMonToolsInstalled = false;
|
|
14
|
+
if (const_1.WINDOWS) {
|
|
15
|
+
try {
|
|
16
|
+
const { stdout } = await (0, exec_1.exec)('WHERE smartctl 2>nul', const_1.execOptsWin);
|
|
17
|
+
const pathArray = stdout.split('\r\n');
|
|
18
|
+
if (pathArray?.length) {
|
|
19
|
+
_smartMonToolsInstalled = pathArray[0].indexOf(':\\') >= 0;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
_smartMonToolsInstalled = false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
_smartMonToolsInstalled = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (const_1.LINUX || const_1.DARWIN || const_1.FREEBSD || const_1.NETBSD) {
|
|
30
|
+
try {
|
|
31
|
+
const { stdout } = await (0, exec_1.exec)('which smartctl 2>/dev/null');
|
|
32
|
+
const pathArray = stdout.split('\r\n');
|
|
33
|
+
_smartMonToolsInstalled = pathArray.length > 0;
|
|
34
|
+
}
|
|
35
|
+
catch { }
|
|
36
|
+
}
|
|
37
|
+
return _smartMonToolsInstalled;
|
|
38
|
+
};
|
|
39
|
+
exports.smartMonToolsInstalled = smartMonToolsInstalled;
|
|
40
|
+
exports._fs_speed = {};
|
|
41
|
+
const calcFsSpeed = (rx, wx) => {
|
|
42
|
+
const result = (0, index_1.cloneObj)(defaults_1.initFsStats);
|
|
43
|
+
if (exports._fs_speed?.ms) {
|
|
44
|
+
result.rx = rx;
|
|
45
|
+
result.wx = wx;
|
|
46
|
+
result.tx = result.rx + result.wx;
|
|
47
|
+
result.ms = Date.now() - exports._fs_speed.ms;
|
|
48
|
+
result.rx_sec = (result.rx - exports._fs_speed.bytes_read) / (result.ms / 1000);
|
|
49
|
+
result.wx_sec = (result.wx - exports._fs_speed.bytes_write) / (result.ms / 1000);
|
|
50
|
+
result.tx_sec = result.rx_sec + result.wx_sec;
|
|
51
|
+
exports._fs_speed.rx_sec = result.rx_sec;
|
|
52
|
+
exports._fs_speed.wx_sec = result.wx_sec;
|
|
53
|
+
exports._fs_speed.tx_sec = result.tx_sec;
|
|
54
|
+
exports._fs_speed.bytes_read = result.rx;
|
|
55
|
+
exports._fs_speed.bytes_write = result.wx;
|
|
56
|
+
exports._fs_speed.bytes_overall = result.rx + result.wx;
|
|
57
|
+
exports._fs_speed.ms = Date.now();
|
|
58
|
+
exports._fs_speed.last_ms = result.ms;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
result.rx = rx;
|
|
62
|
+
result.wx = wx;
|
|
63
|
+
result.tx = result.rx + result.wx;
|
|
64
|
+
exports._fs_speed.rx_sec = null;
|
|
65
|
+
exports._fs_speed.wx_sec = null;
|
|
66
|
+
exports._fs_speed.tx_sec = null;
|
|
67
|
+
exports._fs_speed.bytes_read = result.rx;
|
|
68
|
+
exports._fs_speed.bytes_write = result.wx;
|
|
69
|
+
exports._fs_speed.bytes_overall = result.rx + result.wx;
|
|
70
|
+
exports._fs_speed.ms = Date.now();
|
|
71
|
+
exports._fs_speed.last_ms = 0;
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
exports.calcFsSpeed = calcFsSpeed;
|
|
76
|
+
exports._disk_io = {};
|
|
77
|
+
const calcDiskIO = (rIO, wIO, rWaitTime, wWaitTime, tWaitTime) => {
|
|
78
|
+
const result = (0, index_1.cloneObj)(defaults_1.initDiskIo);
|
|
79
|
+
if (exports._disk_io?.ms) {
|
|
80
|
+
result.rIO = rIO;
|
|
81
|
+
result.wIO = wIO;
|
|
82
|
+
result.tIO = rIO + wIO;
|
|
83
|
+
result.ms = Date.now() - exports._disk_io.ms;
|
|
84
|
+
result.rIO_sec = (result.rIO - exports._disk_io.rIO) / (result.ms / 1000);
|
|
85
|
+
result.wIO_sec = (result.wIO - exports._disk_io.wIO) / (result.ms / 1000);
|
|
86
|
+
result.tIO_sec = result.rIO_sec + result.wIO_sec;
|
|
87
|
+
result.rWaitTime = rWaitTime;
|
|
88
|
+
result.wWaitTime = wWaitTime;
|
|
89
|
+
result.tWaitTime = tWaitTime;
|
|
90
|
+
result.rWaitPercent = ((result.rWaitTime - exports._disk_io.rWaitTime) * 100) / result.ms;
|
|
91
|
+
result.wWaitPercent = ((result.wWaitTime - exports._disk_io.wWaitTime) * 100) / result.ms;
|
|
92
|
+
result.tWaitPercent = ((result.tWaitTime - exports._disk_io.tWaitTime) * 100) / result.ms;
|
|
93
|
+
exports._disk_io.rIO = rIO;
|
|
94
|
+
exports._disk_io.wIO = wIO;
|
|
95
|
+
exports._disk_io.rIO_sec = result.rIO_sec;
|
|
96
|
+
exports._disk_io.wIO_sec = result.wIO_sec;
|
|
97
|
+
exports._disk_io.tIO_sec = result.tIO_sec;
|
|
98
|
+
exports._disk_io.rWaitTime = rWaitTime;
|
|
99
|
+
exports._disk_io.wWaitTime = wWaitTime;
|
|
100
|
+
exports._disk_io.tWaitTime = tWaitTime;
|
|
101
|
+
exports._disk_io.rWaitPercent = result.rWaitPercent;
|
|
102
|
+
exports._disk_io.wWaitPercent = result.wWaitPercent;
|
|
103
|
+
exports._disk_io.tWaitPercent = result.tWaitPercent;
|
|
104
|
+
exports._disk_io.last_ms = result.ms;
|
|
105
|
+
exports._disk_io.ms = Date.now();
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
result.rIO = rIO;
|
|
109
|
+
result.wIO = wIO;
|
|
110
|
+
result.tIO = rIO + wIO;
|
|
111
|
+
result.rWaitTime = rWaitTime;
|
|
112
|
+
result.wWaitTime = wWaitTime;
|
|
113
|
+
result.tWaitTime = tWaitTime;
|
|
114
|
+
exports._disk_io.rIO = rIO;
|
|
115
|
+
exports._disk_io.wIO = wIO;
|
|
116
|
+
exports._disk_io.rIO_sec = null;
|
|
117
|
+
exports._disk_io.wIO_sec = null;
|
|
118
|
+
exports._disk_io.tIO_sec = null;
|
|
119
|
+
exports._disk_io.rWaitTime = rWaitTime;
|
|
120
|
+
exports._disk_io.wWaitTime = wWaitTime;
|
|
121
|
+
exports._disk_io.tWaitTime = tWaitTime;
|
|
122
|
+
exports._disk_io.rWaitPercent = null;
|
|
123
|
+
exports._disk_io.wWaitPercent = null;
|
|
124
|
+
exports._disk_io.tWaitPercent = null;
|
|
125
|
+
exports._disk_io.last_ms = 0;
|
|
126
|
+
exports._disk_io.ms = Date.now();
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
};
|
|
130
|
+
exports.calcDiskIO = calcDiskIO;
|
|
131
|
+
const blkStdoutToObject = (stdout) => {
|
|
132
|
+
return stdout
|
|
133
|
+
.replace(/NAME=/g, '{"name":')
|
|
134
|
+
.replace(/FSTYPE=/g, ',"fsType":')
|
|
135
|
+
.replace(/TYPE=/g, ',"type":')
|
|
136
|
+
.replace(/SIZE=/g, ',"size":')
|
|
137
|
+
.replace(/MOUNTPOINT=/g, ',"mountpoint":')
|
|
138
|
+
.replace(/UUID=/g, ',"uuid":')
|
|
139
|
+
.replace(/ROTA=/g, ',"rota":')
|
|
140
|
+
.replace(/RO=/g, ',"ro":')
|
|
141
|
+
.replace(/RM=/g, ',"rm":')
|
|
142
|
+
.replace(/TRAN=/g, ',"tran":')
|
|
143
|
+
.replace(/SERIAL=/g, ',"serial":')
|
|
144
|
+
.replace(/LABEL=/g, ',"label":')
|
|
145
|
+
.replace(/MODEL=/g, ',"model":')
|
|
146
|
+
.replace(/OWNER=/g, ',"owner":')
|
|
147
|
+
.replace(/GROUP=/g, ',"group":')
|
|
148
|
+
.replace(/\n/g, '}\n');
|
|
149
|
+
};
|
|
150
|
+
exports.blkStdoutToObject = blkStdoutToObject;
|
|
151
|
+
const parseLinuxBlk = (lines) => {
|
|
152
|
+
const defaults = (0, index_1.cloneObj)(defaults_1.initFsBlockDevice);
|
|
153
|
+
let data = [];
|
|
154
|
+
lines
|
|
155
|
+
.filter((line) => line !== '')
|
|
156
|
+
.forEach((line) => {
|
|
157
|
+
try {
|
|
158
|
+
line = decodeURIComponent(line.replace(/\\x/g, '%'));
|
|
159
|
+
line = line.replace(/\\/g, '\\\\');
|
|
160
|
+
const disk = JSON.parse(line);
|
|
161
|
+
data.push({
|
|
162
|
+
...defaults,
|
|
163
|
+
name: disk.name,
|
|
164
|
+
type: disk.type,
|
|
165
|
+
fsType: disk.fsType,
|
|
166
|
+
mount: disk.mountpoint,
|
|
167
|
+
size: (0, index_1.toInt)(disk.size),
|
|
168
|
+
physical: disk.type === 'disk' ? (disk.rota === '0' ? 'SSD' : 'HDD') : disk.type === 'rom' ? 'CD/DVD' : '',
|
|
169
|
+
uuid: disk.uuid,
|
|
170
|
+
label: disk.label,
|
|
171
|
+
model: disk.model,
|
|
172
|
+
serial: disk.serial,
|
|
173
|
+
removable: disk.rm === '1',
|
|
174
|
+
protocol: disk.tran,
|
|
175
|
+
group: disk.group
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
catch { }
|
|
179
|
+
});
|
|
180
|
+
data = (0, index_1.unique)(data);
|
|
181
|
+
data = (0, index_1.sortByKey)(data, ['type', 'name']);
|
|
182
|
+
return data;
|
|
183
|
+
};
|
|
184
|
+
exports.parseLinuxBlk = parseLinuxBlk;
|
|
185
|
+
const decodeMdabmData = (lines) => {
|
|
186
|
+
const raid = (0, index_1.getValue)(lines, 'md_level', '=');
|
|
187
|
+
const label = (0, index_1.getValue)(lines, 'md_name', '=');
|
|
188
|
+
const uuid = (0, index_1.getValue)(lines, 'md_uuid', '=');
|
|
189
|
+
const members = [];
|
|
190
|
+
lines.forEach((line) => {
|
|
191
|
+
if (line.toLowerCase().startsWith('md_device_dev') && line.toLowerCase().indexOf('/dev/') > 0) {
|
|
192
|
+
members.push(line.split('/dev/')[1]);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
return {
|
|
196
|
+
raid,
|
|
197
|
+
label,
|
|
198
|
+
uuid,
|
|
199
|
+
members
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
const raidMatchLinux = async (data) => {
|
|
203
|
+
let result = data;
|
|
204
|
+
try {
|
|
205
|
+
for (const element of data) {
|
|
206
|
+
if (element.type.startsWith('raid')) {
|
|
207
|
+
const stdout = await (0, exec_1.execSecure)('mdadm', ['--export', '--detail', `/dev/${element.name}`]);
|
|
208
|
+
const lines = stdout.split('\n');
|
|
209
|
+
const mdData = decodeMdabmData(lines);
|
|
210
|
+
element.label = mdData.label;
|
|
211
|
+
element.uuid = mdData.uuid;
|
|
212
|
+
if (mdData.members?.length && mdData.raid === element.type) {
|
|
213
|
+
result = result.map((blockdevice) => {
|
|
214
|
+
if (blockdevice.fsType === 'linux_raid_member' && mdData.members.indexOf(blockdevice.name) >= 0) {
|
|
215
|
+
blockdevice.group = element.name;
|
|
216
|
+
}
|
|
217
|
+
return blockdevice;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch { }
|
|
224
|
+
return result;
|
|
225
|
+
};
|
|
226
|
+
exports.raidMatchLinux = raidMatchLinux;
|
|
227
|
+
const getDevicesLinux = (data) => {
|
|
228
|
+
const result = [];
|
|
229
|
+
data.forEach((element) => {
|
|
230
|
+
if (element.type.startsWith('disk')) {
|
|
231
|
+
result.push(element.name);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
return result;
|
|
235
|
+
};
|
|
236
|
+
const matchDevicesLinux = (data) => {
|
|
237
|
+
let result = data;
|
|
238
|
+
try {
|
|
239
|
+
const devices = getDevicesLinux(data);
|
|
240
|
+
result = result.map((blockdevice) => {
|
|
241
|
+
if (blockdevice.type.startsWith('part') || blockdevice.type.startsWith('disk')) {
|
|
242
|
+
devices.forEach((element) => {
|
|
243
|
+
if (blockdevice.name.startsWith(element)) {
|
|
244
|
+
blockdevice.device = '/dev/' + element;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return blockdevice;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
catch { }
|
|
252
|
+
return result;
|
|
253
|
+
};
|
|
254
|
+
exports.matchDevicesLinux = matchDevicesLinux;
|
|
255
|
+
const getDevicesWin = (diskDrives) => {
|
|
256
|
+
const result = [];
|
|
257
|
+
diskDrives.forEach((element) => {
|
|
258
|
+
const lines = element.split('\r\n');
|
|
259
|
+
const device = (0, index_1.getValue)(lines, 'DeviceID', ':');
|
|
260
|
+
let partitions = element.split('@{DeviceID=');
|
|
261
|
+
if (partitions.length > 1) {
|
|
262
|
+
partitions = partitions.slice(1);
|
|
263
|
+
partitions.forEach((partition) => {
|
|
264
|
+
result.push({ name: partition.split(';')[0].toUpperCase(), device });
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
return result;
|
|
269
|
+
};
|
|
270
|
+
const matchDevicesWin = (data, diskDrives) => {
|
|
271
|
+
const devices = getDevicesWin(diskDrives);
|
|
272
|
+
data.forEach((element) => {
|
|
273
|
+
const filteresDevices = devices.filter((e) => {
|
|
274
|
+
return e.name === element.name.toUpperCase();
|
|
275
|
+
});
|
|
276
|
+
if (filteresDevices.length > 0) {
|
|
277
|
+
element.device = filteresDevices[0].device;
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
return data;
|
|
281
|
+
};
|
|
282
|
+
exports.matchDevicesWin = matchDevicesWin;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUniqueMacAddresses = exports.getFQDN = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const const_1 = require("./const");
|
|
6
|
+
const exec_1 = require("./exec");
|
|
7
|
+
const getFQDN = async () => {
|
|
8
|
+
try {
|
|
9
|
+
let stdout = '';
|
|
10
|
+
switch (true) {
|
|
11
|
+
case const_1.LINUX || const_1.DARWIN:
|
|
12
|
+
try {
|
|
13
|
+
({ stdout } = await (0, exec_1.exec)('hostname -f 2>/dev/null'));
|
|
14
|
+
return stdout.toString().split(node_os_1.EOL)[0];
|
|
15
|
+
}
|
|
16
|
+
catch { }
|
|
17
|
+
break;
|
|
18
|
+
case const_1.FREEBSD || const_1.NETBSD || const_1.OPENBSD:
|
|
19
|
+
try {
|
|
20
|
+
({ stdout } = await (0, exec_1.exec)('hostname 2>/dev/null'));
|
|
21
|
+
return stdout.split(node_os_1.EOL)[0];
|
|
22
|
+
}
|
|
23
|
+
catch { }
|
|
24
|
+
break;
|
|
25
|
+
case const_1.WINDOWS:
|
|
26
|
+
({ stdout } = await (0, exec_1.exec)('echo %COMPUTERNAME%.%USERDNSDOMAIN%'));
|
|
27
|
+
return stdout.toString().replace('.%USERDNSDOMAIN%', '').split(node_os_1.EOL)[0];
|
|
28
|
+
default:
|
|
29
|
+
return (0, node_os_1.hostname)();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch { }
|
|
33
|
+
return (0, node_os_1.hostname)();
|
|
34
|
+
};
|
|
35
|
+
exports.getFQDN = getFQDN;
|
|
36
|
+
const getUniqueMacAddresses = () => {
|
|
37
|
+
let macs = [];
|
|
38
|
+
try {
|
|
39
|
+
const interfaces = (0, node_os_1.networkInterfaces)();
|
|
40
|
+
for (const dev in interfaces) {
|
|
41
|
+
if (Object.keys(interfaces).includes(dev)) {
|
|
42
|
+
interfaces[dev]?.forEach((details) => {
|
|
43
|
+
if (details?.mac && details.mac !== '00:00:00:00:00:00') {
|
|
44
|
+
const mac = details.mac.toLowerCase();
|
|
45
|
+
if (macs.indexOf(mac) === -1) {
|
|
46
|
+
macs.push(mac);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
macs = macs.sort((a, b) => {
|
|
53
|
+
if (a < b) {
|
|
54
|
+
return -1;
|
|
55
|
+
}
|
|
56
|
+
if (a > b) {
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
return 0;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
macs.push('00:00:00:00:00:00');
|
|
64
|
+
}
|
|
65
|
+
return macs;
|
|
66
|
+
};
|
|
67
|
+
exports.getUniqueMacAddresses = getUniqueMacAddresses;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const toInt: (value: any) => number;
|
|
2
|
+
export declare const hex2bin: (hex: string) => string;
|
|
3
|
+
export declare const getValue: (lines: string[], property: string, separator?: string, trimmed?: boolean, lineMatch?: boolean) => string;
|
|
4
|
+
export declare const countLines: (lines: string[], startingWith?: string) => number;
|
|
5
|
+
export declare const nextTick: () => Promise<void>;
|
|
6
|
+
export declare const cloneObj: (obj: any) => any;
|
|
7
|
+
export declare const unique: (obj: any[]) => any[];
|
|
8
|
+
export declare const sortByKey: (array: any[], keys: string[]) => any[];
|
|
9
|
+
export declare const findObjectByKey: (array: any[], key: string, value: any) => number;
|
|
10
|
+
export declare const semverCompare: (v1: string, v2: string) => number;
|
|
11
|
+
export declare const cleanString: (str: string) => string;
|
|
12
|
+
export declare const grep: (str: string, pattern: string) => string;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.grep = exports.cleanString = exports.semverCompare = exports.findObjectByKey = exports.sortByKey = exports.unique = exports.cloneObj = exports.nextTick = exports.countLines = exports.getValue = exports.hex2bin = exports.toInt = void 0;
|
|
4
|
+
const toInt = (value) => {
|
|
5
|
+
const result = parseInt(value, 10);
|
|
6
|
+
if (isNaN(result)) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
exports.toInt = toInt;
|
|
12
|
+
const hex2bin = (hex) => {
|
|
13
|
+
return `00000000${(parseInt(hex, 16)).toString(2)}`.slice(-8);
|
|
14
|
+
};
|
|
15
|
+
exports.hex2bin = hex2bin;
|
|
16
|
+
const getValue = (lines, property, separator = ':', trimmed = false, lineMatch = false) => {
|
|
17
|
+
property = property.toLowerCase();
|
|
18
|
+
let result = '';
|
|
19
|
+
lines.some((line) => {
|
|
20
|
+
let lineLower = line.toLowerCase().replace(/\t/g, '');
|
|
21
|
+
if (trimmed) {
|
|
22
|
+
lineLower = lineLower.trim();
|
|
23
|
+
}
|
|
24
|
+
if (lineLower.startsWith(property) && (lineMatch ? lineLower.match(property + separator) || lineLower.match(`${property} ${separator}`) : true)) {
|
|
25
|
+
const parts = trimmed ? line.trim().split(separator) : line.split(separator);
|
|
26
|
+
if (parts.length >= 2) {
|
|
27
|
+
parts.shift();
|
|
28
|
+
result = parts.join(separator).trim();
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
});
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
exports.getValue = getValue;
|
|
37
|
+
const countLines = (lines, startingWith = '') => lines.filter((line) => line.startsWith(startingWith)).length;
|
|
38
|
+
exports.countLines = countLines;
|
|
39
|
+
const nextTick = () => new Promise((resolve) => {
|
|
40
|
+
process.nextTick(() => {
|
|
41
|
+
resolve();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
exports.nextTick = nextTick;
|
|
45
|
+
const cloneObj = (obj) => {
|
|
46
|
+
if (typeof obj === 'object' && obj !== null) {
|
|
47
|
+
try {
|
|
48
|
+
return JSON.parse(JSON.stringify(obj));
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.cloneObj = cloneObj;
|
|
59
|
+
const unique = (obj) => {
|
|
60
|
+
const uniques = [];
|
|
61
|
+
const stringify = {};
|
|
62
|
+
for (let i = 0; i < obj.length; i++) {
|
|
63
|
+
const keys = Object.keys(obj[i]);
|
|
64
|
+
keys.sort((a, b) => {
|
|
65
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
66
|
+
});
|
|
67
|
+
let str = '';
|
|
68
|
+
for (let j = 0; j < keys.length; j++) {
|
|
69
|
+
str += JSON.stringify(keys[j]);
|
|
70
|
+
str += JSON.stringify(obj[i][keys[j]]);
|
|
71
|
+
}
|
|
72
|
+
if (!Object.prototype.hasOwnProperty.call(stringify, str)) {
|
|
73
|
+
uniques.push(obj[i]);
|
|
74
|
+
stringify[str] = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return uniques;
|
|
78
|
+
};
|
|
79
|
+
exports.unique = unique;
|
|
80
|
+
const sortByKey = (array, keys) => {
|
|
81
|
+
return array.sort((a, b) => {
|
|
82
|
+
let x = '';
|
|
83
|
+
let y = '';
|
|
84
|
+
keys.forEach((key) => {
|
|
85
|
+
x = x + a[key];
|
|
86
|
+
y = y + b[key];
|
|
87
|
+
});
|
|
88
|
+
return x < y ? -1 : x > y ? 1 : 0;
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
exports.sortByKey = sortByKey;
|
|
92
|
+
const findObjectByKey = (array, key, value) => {
|
|
93
|
+
for (let i = 0; i < array.length; i++) {
|
|
94
|
+
if (array[i][key] === value) {
|
|
95
|
+
return i;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return -1;
|
|
99
|
+
};
|
|
100
|
+
exports.findObjectByKey = findObjectByKey;
|
|
101
|
+
const semverCompare = (v1, v2) => {
|
|
102
|
+
let res = 0;
|
|
103
|
+
const parts1 = v1.split('.').map((p) => Number.parseInt(p, 10) || 0);
|
|
104
|
+
const parts2 = v2.split('.').map((p) => Number.parseInt(p, 10) || 0);
|
|
105
|
+
if (parts1[0] < parts2[0]) {
|
|
106
|
+
res = 1;
|
|
107
|
+
}
|
|
108
|
+
else if (parts1[0] > parts2[0]) {
|
|
109
|
+
res = -1;
|
|
110
|
+
}
|
|
111
|
+
else if (parts1[0] === parts2[0] && parts1.length >= 2 && parts2.length >= 2) {
|
|
112
|
+
if (parts1[1] < parts2[1]) {
|
|
113
|
+
res = 1;
|
|
114
|
+
}
|
|
115
|
+
else if (parts1[1] > parts2[1]) {
|
|
116
|
+
res = -1;
|
|
117
|
+
}
|
|
118
|
+
else if (parts1[1] === parts2[1]) {
|
|
119
|
+
if (parts1.length >= 3 && parts2.length >= 3) {
|
|
120
|
+
if (parts1[2] < parts2[2]) {
|
|
121
|
+
res = 1;
|
|
122
|
+
}
|
|
123
|
+
else if (parts1[2] > parts2[2]) {
|
|
124
|
+
res = -1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (parts2.length >= 3) {
|
|
128
|
+
res = 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return res;
|
|
133
|
+
};
|
|
134
|
+
exports.semverCompare = semverCompare;
|
|
135
|
+
const cleanString = (str) => {
|
|
136
|
+
return str.replace(/To Be Filled By O.E.M./g, '');
|
|
137
|
+
};
|
|
138
|
+
exports.cleanString = cleanString;
|
|
139
|
+
const grep = (str, pattern) => {
|
|
140
|
+
const result = str
|
|
141
|
+
.split('\n')
|
|
142
|
+
.filter((line) => line.includes(pattern))
|
|
143
|
+
.join('\n');
|
|
144
|
+
return result;
|
|
145
|
+
};
|
|
146
|
+
exports.grep = grep;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkWebsite: (url: string, timeout?: number) => Promise<unknown>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.checkWebsite = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("http"));
|
|
8
|
+
const https_1 = __importDefault(require("https"));
|
|
9
|
+
const checkWebsite = (url, timeout = 5000) => {
|
|
10
|
+
const client = url.startsWith('https:') || url.indexOf(':443/') > 0 || url.indexOf(':8443/') > 0 ? https_1.default : http_1.default;
|
|
11
|
+
const t = Date.now();
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
const request = client
|
|
14
|
+
.get(url, (res) => {
|
|
15
|
+
res.on('data', () => { });
|
|
16
|
+
res.on('end', () => {
|
|
17
|
+
resolve({
|
|
18
|
+
url,
|
|
19
|
+
statusCode: res.statusCode,
|
|
20
|
+
ok: res.statusCode >= 200 && res.statusCode <= 399,
|
|
21
|
+
message: res.statusMessage,
|
|
22
|
+
ms: Date.now() - t
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
})
|
|
26
|
+
.on('error', (e) => {
|
|
27
|
+
resolve({
|
|
28
|
+
url,
|
|
29
|
+
statusCode: 404,
|
|
30
|
+
ok: false,
|
|
31
|
+
message: e.message,
|
|
32
|
+
ms: Date.now() - t
|
|
33
|
+
});
|
|
34
|
+
})
|
|
35
|
+
.setTimeout(timeout, () => {
|
|
36
|
+
request.destroy();
|
|
37
|
+
resolve({
|
|
38
|
+
url,
|
|
39
|
+
statusCode: 408,
|
|
40
|
+
ok: false,
|
|
41
|
+
message: 'Request Timeout',
|
|
42
|
+
ms: Date.now() - t
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.checkWebsite = checkWebsite;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CpuBrandObject } from './types';
|
|
2
|
+
export declare const audioTypeLabel: (type: string, input?: boolean, output?: boolean) => "" | "Speaker" | "Microphone" | "Phone" | "Headset" | "Controller" | "Line Out" | "Digital Out" | "Digital Signal Processor" | "Sound Driver";
|
|
3
|
+
export declare const audioDarwinChannelLabel: (str: string) => "" | "HDMI" | "Built-In" | "Audio-Jack" | "Display-Port" | "USB" | "PCIe";
|
|
4
|
+
export declare const audioWindowsStatus: (statusInfo: number | string) => string;
|
|
5
|
+
export declare const bluetoothTypeLabel: (str: string) => "" | "Speaker" | "Microphone" | "Phone" | "Tablet" | "Headset" | "Keyboard" | "Mouse" | "Trackpad" | "Computer" | "Watch" | "Audio";
|
|
6
|
+
export declare const bluetoothManufacturer: (str: string) => string;
|
|
7
|
+
export declare const manufacturedApple: (str: string) => "" | "Apple";
|
|
8
|
+
export declare const usbLinuxType: (type: string, name: string) => string;
|
|
9
|
+
export declare const usbDarwinType: (name: string) => "" | "Microphone" | "Controller" | "Keyboard" | "Mouse" | "Trackpad" | "Audio" | "Camera" | "Hub" | "Storage" | "Touch Bar" | "Sensor" | "Bluetooth";
|
|
10
|
+
export declare const usbWindowsType: (creationclass: string, name: string) => "" | "Controller" | "Keyboard" | "Mouse" | "Hub" | "Storage";
|
|
11
|
+
export declare const wifiVendor: (model: string) => "" | "Intel" | "Realtek" | "Qualcom" | "Broadcom" | "Cavium" | "Cisco" | "Marvel" | "Zyxel" | "Melanox" | "D-Link" | "TP-Link" | "Asus" | "Linksys";
|
|
12
|
+
export declare const getLogoFile: (distro?: string) => NodeJS.Platform | "apple" | "windows" | "arch" | "cachy" | "centos" | "coreos" | "debian" | "deepin" | "elementary" | "endeavour" | "fedora" | "gentoo" | "mageia" | "mandriva" | "manjaro" | "mint" | "mx" | "opensuse" | "pclinuxos" | "puppy" | "popos" | "raspbian" | "reactos" | "redhat" | "slackware" | "sugar" | "steam" | "suse" | "ubuntu-mate" | "lubuntu" | "xubuntu" | "ubuntu" | "solaris" | "tails" | "ferenos" | "robolinux";
|
|
13
|
+
export declare const getWindowsRelease: (build: number) => string;
|
|
14
|
+
export declare const JEDEV_RAM_manufacturers: {
|
|
15
|
+
[index: string]: any;
|
|
16
|
+
};
|
|
17
|
+
export declare const getMemManufacturer: (manId: string) => string;
|
|
18
|
+
export declare const raspberryClockSpeed: {
|
|
19
|
+
[index: string]: any;
|
|
20
|
+
};
|
|
21
|
+
export declare const winPrinterStatus: {
|
|
22
|
+
[index: string]: any;
|
|
23
|
+
};
|
|
24
|
+
export declare const getSocketTypesByName: (str: string) => string;
|
|
25
|
+
export declare const cpuManufacturer: (str: string) => string;
|
|
26
|
+
export declare const getAMDSpeed: (brand: string) => number;
|
|
27
|
+
export declare const cpuBrandManufacturer: (brand: string) => CpuBrandObject;
|
|
28
|
+
export declare const socketTypes: {
|
|
29
|
+
[index: string]: any;
|
|
30
|
+
};
|
|
31
|
+
export declare const wifiFrequencies: {
|
|
32
|
+
[index: number]: any;
|
|
33
|
+
};
|
|
34
|
+
export declare const chassisTypes: string[];
|
|
35
|
+
export declare const diskVendorFromModel: (model: string) => string;
|
|
36
|
+
export declare const graphicsVideoTypes: {
|
|
37
|
+
[index: string]: any;
|
|
38
|
+
};
|
|
39
|
+
export declare const graphicsModelToVendor: (model: string) => string;
|
|
40
|
+
export declare const graphicsIdToVendor: (id: string) => any;
|
|
41
|
+
export declare const graphicsVendorToId: (str: string) => string;
|
|
42
|
+
export declare const graphicsMetalVersion: (id: string) => any;
|
|
43
|
+
export declare const winProcessStatus: {
|
|
44
|
+
[index: string]: any;
|
|
45
|
+
};
|
|
46
|
+
export declare const getAppleModel: (key: string) => {
|
|
47
|
+
key: string;
|
|
48
|
+
model: string;
|
|
49
|
+
version: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const getAppleChassisType: (model: string) => "Other" | "Desktop" | "Tower" | "Notebook";
|
|
52
|
+
export declare const bluetoothVendors: {
|
|
53
|
+
[index: number]: any;
|
|
54
|
+
};
|
|
55
|
+
export declare const parseBluetoothVendor: (str: string) => void;
|