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,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chassis = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const mappings_1 = require("../common/mappings");
|
|
8
|
+
const parseChassisObject = (data) => {
|
|
9
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initChassis);
|
|
10
|
+
const lines = data.toString().replace(/[<>"]/g, '').split('\n');
|
|
11
|
+
const model = (0, mappings_1.getAppleModel)((0, common_1.getValue)(lines, 'model', '=', true));
|
|
12
|
+
return {
|
|
13
|
+
...defaults,
|
|
14
|
+
manufacturer: (0, common_1.getValue)(lines, 'manufacturer', '=', true),
|
|
15
|
+
model: model.key,
|
|
16
|
+
type: (0, mappings_1.getAppleChassisType)(model.model),
|
|
17
|
+
version: model.version,
|
|
18
|
+
serial: (0, common_1.getValue)(lines, 'ioplatformserialnumber', '=', true),
|
|
19
|
+
assetTag: (0, common_1.getValue)(lines, 'board-id', '=', true) || (0, common_1.getValue)(lines, 'target-type', '=', true),
|
|
20
|
+
sku: (0, common_1.getValue)(lines, 'target-sub-type', '=', true)
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const chassis = async () => {
|
|
24
|
+
await (0, common_1.nextTick)();
|
|
25
|
+
let stdout = '';
|
|
26
|
+
try {
|
|
27
|
+
({ stdout } = await (0, exec_1.exec)('ioreg -c IOPlatformExpertDevice -d 2'));
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
30
|
+
return parseChassisObject(stdout);
|
|
31
|
+
};
|
|
32
|
+
exports.chassis = chassis;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuCache = void 0;
|
|
4
|
+
const index_1 = require("../common/index");
|
|
5
|
+
const exec_1 = require("../common/exec");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const parseCpuCache = (data) => {
|
|
8
|
+
const lines = data.toString().split('\n');
|
|
9
|
+
const l1dString = (0, index_1.getValue)(lines, 'hw.l1dcachesize');
|
|
10
|
+
const l1iString = (0, index_1.getValue)(lines, 'hw.l1icachesize');
|
|
11
|
+
const l2String = (0, index_1.getValue)(lines, 'hw.l2cachesize');
|
|
12
|
+
const l3String = (0, index_1.getValue)(lines, 'hw.l3cachesize');
|
|
13
|
+
return {
|
|
14
|
+
l1d: (0, index_1.toInt)(l1dString) * (l1dString.indexOf('K') >= 0 ? 1024 : 1),
|
|
15
|
+
l1i: (0, index_1.toInt)(l1iString) * (l1iString.indexOf('K') >= 0 ? 1024 : 1),
|
|
16
|
+
l2: (0, index_1.toInt)(l2String) * (l2String.indexOf('K') >= 0 ? 1024 : 1),
|
|
17
|
+
l3: (0, index_1.toInt)(l3String) * (l3String.indexOf('K') >= 0 ? 1024 : 1)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const cpuCache = async () => {
|
|
21
|
+
await (0, common_1.nextTick)();
|
|
22
|
+
let stdout = '';
|
|
23
|
+
try {
|
|
24
|
+
({ stdout } = await (0, exec_1.exec)('sysctl -i hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize'));
|
|
25
|
+
}
|
|
26
|
+
catch { }
|
|
27
|
+
return parseCpuCache(stdout);
|
|
28
|
+
};
|
|
29
|
+
exports.cpuCache = cpuCache;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpuFlags: () => Promise<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuFlags = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const exec_1 = require("../common/exec");
|
|
6
|
+
const cpuFlags = async () => {
|
|
7
|
+
await (0, common_1.nextTick)();
|
|
8
|
+
let stdout = '';
|
|
9
|
+
try {
|
|
10
|
+
({ stdout } = await (0, exec_1.exec)('sysctl -i machdep.cpu.features'));
|
|
11
|
+
}
|
|
12
|
+
catch { }
|
|
13
|
+
const lines = stdout.split('\n');
|
|
14
|
+
return (0, common_1.getValue)(lines, 'machdep.cpu.features').toLowerCase();
|
|
15
|
+
};
|
|
16
|
+
exports.cpuFlags = cpuFlags;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpuTemperature: () => Promise<any>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuTemperature = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const cpuTemperature = async () => {
|
|
7
|
+
await (0, common_1.nextTick)();
|
|
8
|
+
let result = (0, common_1.cloneObj)(defaults_1.initCpuTemperature);
|
|
9
|
+
try {
|
|
10
|
+
const osxTemp = require('osx-temperature-sensor');
|
|
11
|
+
result = osxTemp.cpuTemperature();
|
|
12
|
+
if (result.main) {
|
|
13
|
+
result.main = Math.round(result.main * 100) / 100;
|
|
14
|
+
}
|
|
15
|
+
if (result.max) {
|
|
16
|
+
result.max = Math.round(result.max * 100) / 100;
|
|
17
|
+
}
|
|
18
|
+
if (result.cores && result.cores.length) {
|
|
19
|
+
for (let i = 0; i < result.cores.length; i++) {
|
|
20
|
+
result.cores[i] = Math.round(result.cores[i] * 100) / 100;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch { }
|
|
25
|
+
try {
|
|
26
|
+
const macosTemp = require('macos-temperature-sensor');
|
|
27
|
+
const res = macosTemp.temperature();
|
|
28
|
+
if (res.cpu) {
|
|
29
|
+
result.main = Math.round(res.cpu * 100) / 100;
|
|
30
|
+
result.max = result.main;
|
|
31
|
+
}
|
|
32
|
+
if (res.soc) {
|
|
33
|
+
result.chipset = Math.round(res.soc * 100) / 100;
|
|
34
|
+
}
|
|
35
|
+
if (res && res.cpuDieTemps && res.cpuDieTemps.length) {
|
|
36
|
+
for (const temp of res.cpuDieTemps) {
|
|
37
|
+
result.cores.push(Math.round(temp * 100) / 100);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch { }
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
exports.cpuTemperature = cpuTemperature;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpu: () => Promise<any>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpu = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const cpu_1 = require("../common/cpu");
|
|
7
|
+
const defaults_1 = require("../common/defaults");
|
|
8
|
+
const exec_1 = require("../common/exec");
|
|
9
|
+
const mappings_1 = require("../common/mappings");
|
|
10
|
+
const cpu_cache_1 = require("./cpu-cache");
|
|
11
|
+
const cpu_flags_1 = require("./cpu-flags");
|
|
12
|
+
const cpu = async () => {
|
|
13
|
+
await (0, common_1.nextTick)();
|
|
14
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initCpuResult);
|
|
15
|
+
const flags = await (0, cpu_flags_1.cpuFlags)();
|
|
16
|
+
let stdout = '';
|
|
17
|
+
try {
|
|
18
|
+
({ stdout } = await (0, exec_1.exec)('sysctl -i machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily'));
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
21
|
+
const lines = stdout.split('\n');
|
|
22
|
+
const modelline = (0, common_1.getValue)(lines, 'machdep.cpu.brand_string');
|
|
23
|
+
const modellineParts = modelline.split('@');
|
|
24
|
+
const speedStr = modellineParts[1] ? modellineParts[1].trim() : '0';
|
|
25
|
+
let speed = parseFloat(speedStr.replace(/GHz+/g, ''));
|
|
26
|
+
let tbFrequency = parseInt((0, common_1.getValue)(lines, 'hw.tbfrequency'), 10) / 1000000000.0;
|
|
27
|
+
tbFrequency = tbFrequency < 0.1 ? tbFrequency * 100 : tbFrequency;
|
|
28
|
+
speed = speed === 0 ? tbFrequency : speed;
|
|
29
|
+
(0, cpu_1.setCpuSpeed)(speed);
|
|
30
|
+
const brandObject = (0, mappings_1.cpuBrandManufacturer)(modellineParts[0].trim());
|
|
31
|
+
const countProcessors = (0, common_1.getValue)(lines, 'hw.packages');
|
|
32
|
+
const countCores = (0, common_1.getValue)(lines, 'hw.physicalcpu_max');
|
|
33
|
+
const countThreads = (0, common_1.getValue)(lines, 'hw.ncpu');
|
|
34
|
+
let socket = defaults.socket;
|
|
35
|
+
let efficiencyCores = null;
|
|
36
|
+
let performanceCores = null;
|
|
37
|
+
if ((0, node_os_1.arch)() === 'arm64') {
|
|
38
|
+
try {
|
|
39
|
+
const { stdout } = await (0, exec_1.exec)('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type');
|
|
40
|
+
const clusters = stdout.split('\n');
|
|
41
|
+
efficiencyCores = clusters.filter((line) => line.indexOf('"E"') >= 0).length + clusters.filter((line) => line.indexOf('"M"') >= 0).length;
|
|
42
|
+
performanceCores = clusters.filter((line) => line.indexOf('"P"') >= 0).length;
|
|
43
|
+
socket = 'SOC';
|
|
44
|
+
}
|
|
45
|
+
catch { }
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...defaults,
|
|
49
|
+
flags,
|
|
50
|
+
virtualization: flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1,
|
|
51
|
+
brand: brandObject.brand,
|
|
52
|
+
manufacturer: brandObject.manufacturer,
|
|
53
|
+
speed,
|
|
54
|
+
speedMin: (0, common_1.getValue)(lines, 'hw.cpufrequency_min') ? (0, common_1.toInt)((0, common_1.getValue)(lines, 'hw.cpufrequency_min')) / 1000000000.0 : speed,
|
|
55
|
+
speedMax: (0, common_1.getValue)(lines, 'hw.cpufrequency_max') ? (0, common_1.toInt)((0, common_1.getValue)(lines, 'hw.cpufrequency_max')) / 1000000000.0 : speed,
|
|
56
|
+
vendor: (0, common_1.getValue)(lines, 'machdep.cpu.vendor') || 'Apple',
|
|
57
|
+
family: (0, common_1.getValue)(lines, 'machdep.cpu.family') || (0, common_1.getValue)(lines, 'hw.cpufamily'),
|
|
58
|
+
model: (0, common_1.getValue)(lines, 'machdep.cpu.model'),
|
|
59
|
+
stepping: (0, common_1.getValue)(lines, 'machdep.cpu.stepping') || (0, common_1.getValue)(lines, 'hw.cpusubfamily'),
|
|
60
|
+
socket,
|
|
61
|
+
processors: (0, common_1.toInt)(countProcessors) || 1,
|
|
62
|
+
cores: (0, common_1.toInt)(countThreads) || (0, node_os_1.cpus)().length,
|
|
63
|
+
physicalCores: (0, common_1.toInt)(countCores) || (0, node_os_1.cpus)().length,
|
|
64
|
+
efficiencyCores,
|
|
65
|
+
performanceCores,
|
|
66
|
+
cache: await (0, cpu_cache_1.cpuCache)()
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
exports.cpu = cpu;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diskLayout = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const darwin_1 = require("../common/darwin");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const diskLayout = async () => {
|
|
10
|
+
await (0, common_1.nextTick)();
|
|
11
|
+
const result = [];
|
|
12
|
+
let stdout = '';
|
|
13
|
+
let cmd = '';
|
|
14
|
+
let cmdFullSmart = '';
|
|
15
|
+
try {
|
|
16
|
+
({ stdout } = await (0, exec_1.exec)(`system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType SPStorageDataType -xml`, { maxBuffer: const_1.MAX_BUFFER_SIZE }));
|
|
17
|
+
const data = (0, darwin_1.plistParser)(stdout, false);
|
|
18
|
+
const diskSATA = data.length >= 4 && data[0]._items ? data[0]._items : [];
|
|
19
|
+
const diskNVME = data.length >= 4 && data[1]._items ? data[1]._items : [];
|
|
20
|
+
const diskUSB = data.length >= 4 && data[2]._items ? data[2]._items : [];
|
|
21
|
+
const diskLine = data.length >= 4 && data[3]._items ? data[3]._items : [];
|
|
22
|
+
if (diskSATA?.length && diskSATA._items) {
|
|
23
|
+
diskSATA.forEach((controller) => {
|
|
24
|
+
if (controller?._items && controller._items.length) {
|
|
25
|
+
const deviceType = controller._names && controller._names.tolower().indexOf('ssd') >= 0 ? 'SSD' : 'HD';
|
|
26
|
+
controller._items.forEach((disk) => {
|
|
27
|
+
result.push({
|
|
28
|
+
device: disk.bsd_name,
|
|
29
|
+
type: deviceType,
|
|
30
|
+
name: disk._name || '',
|
|
31
|
+
vendor: (0, mappings_1.diskVendorFromModel)(disk.device_model || disk.manufacturer || disk._name),
|
|
32
|
+
size: disk.size_in_bytes,
|
|
33
|
+
bytesPerSector: null,
|
|
34
|
+
totalCylinders: null,
|
|
35
|
+
totalHeads: null,
|
|
36
|
+
totalSectors: null,
|
|
37
|
+
totalTracks: null,
|
|
38
|
+
tracksPerCylinder: null,
|
|
39
|
+
sectorsPerTrack: null,
|
|
40
|
+
firmwareRevision: disk.device_revision || '',
|
|
41
|
+
serialNum: disk.device_serial || '',
|
|
42
|
+
interfaceType: 'PCIe ' + (disk.spnvme_linkwidth || ''),
|
|
43
|
+
smartStatus: disk.smart_status === 'verified' ? 'OK' : disk.smart_status || 'unknown',
|
|
44
|
+
temperature: null,
|
|
45
|
+
bsdName: disk.bsd_name
|
|
46
|
+
});
|
|
47
|
+
cmd += 'printf "\n' + disk.bsd_name + '|"; diskutil info /dev/' + disk.bsd_name + ' | grep SMART;';
|
|
48
|
+
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${disk.bsd_name};`;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (diskNVME?.length) {
|
|
54
|
+
diskNVME.forEach((controller) => {
|
|
55
|
+
if (controller?._items && controller._items.length) {
|
|
56
|
+
controller._items.forEach((disk) => {
|
|
57
|
+
result.push({
|
|
58
|
+
device: disk.bsd_name,
|
|
59
|
+
type: 'NVMe',
|
|
60
|
+
name: disk._name || '',
|
|
61
|
+
vendor: (0, mappings_1.diskVendorFromModel)(disk.device_model || disk.manufacturer || disk._name),
|
|
62
|
+
size: disk.size_in_bytes,
|
|
63
|
+
bytesPerSector: null,
|
|
64
|
+
totalCylinders: null,
|
|
65
|
+
totalHeads: null,
|
|
66
|
+
totalSectors: null,
|
|
67
|
+
totalTracks: null,
|
|
68
|
+
tracksPerCylinder: null,
|
|
69
|
+
sectorsPerTrack: null,
|
|
70
|
+
firmwareRevision: disk.device_revision || '',
|
|
71
|
+
serialNum: disk.device_serial || '',
|
|
72
|
+
interfaceType: 'PCIe ' + (disk.spnvme_linkwidth || ''),
|
|
73
|
+
smartStatus: disk.smart_status === 'verified' ? 'OK' : disk.smart_status || 'unknown',
|
|
74
|
+
temperature: null,
|
|
75
|
+
bsdName: disk.bsd_name
|
|
76
|
+
});
|
|
77
|
+
cmd += 'printf "\n' + disk.bsd_name + '|"; diskutil info /dev/' + disk.bsd_name + ' | grep SMART;';
|
|
78
|
+
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${disk.bsd_name};`;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (diskUSB?.length) {
|
|
84
|
+
diskUSB.forEach((controller) => {
|
|
85
|
+
if (controller?._items && controller._items.length) {
|
|
86
|
+
controller._items.forEach((disk) => {
|
|
87
|
+
if (disk.Media?.length && disk.Media[0] && disk.Media[0].size_in_bytes && disk.Media[0].bsd_name) {
|
|
88
|
+
const media = disk.Media[0];
|
|
89
|
+
result.push({
|
|
90
|
+
device: media.bsd_name,
|
|
91
|
+
type: 'USB',
|
|
92
|
+
name: disk._name || '',
|
|
93
|
+
vendor: (0, mappings_1.diskVendorFromModel)(disk.manufacturer || disk.vendor_id || disk._name) || disk.manufacturer || '',
|
|
94
|
+
size: media.size_in_bytes,
|
|
95
|
+
bytesPerSector: null,
|
|
96
|
+
totalCylinders: null,
|
|
97
|
+
totalHeads: null,
|
|
98
|
+
totalSectors: null,
|
|
99
|
+
totalTracks: null,
|
|
100
|
+
tracksPerCylinder: null,
|
|
101
|
+
sectorsPerTrack: null,
|
|
102
|
+
firmwareRevision: disk.device_revision || '',
|
|
103
|
+
serialNum: disk.serial_num || '',
|
|
104
|
+
interfaceType: 'USB',
|
|
105
|
+
smartStatus: disk.smart_status === 'verified' ? 'OK' : disk.smart_status || 'unknown',
|
|
106
|
+
temperature: null,
|
|
107
|
+
bsdName: media.bsd_name
|
|
108
|
+
});
|
|
109
|
+
cmd += 'printf "\n' + media.bsd_name + '|"; diskutil info /dev/' + media.bsd_name + ' | grep SMART;';
|
|
110
|
+
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${disk.bsd_name};`;
|
|
111
|
+
}
|
|
112
|
+
else if (disk?._items.length) {
|
|
113
|
+
disk._items.forEach((subdisk) => {
|
|
114
|
+
if (subdisk.Media && subdisk.Media?.length && subdisk.Media[0] && subdisk.Media[0].size_in_bytes && subdisk.Media[0].bsd_name) {
|
|
115
|
+
const media = subdisk.Media[0];
|
|
116
|
+
result.push({
|
|
117
|
+
device: media.bsd_name,
|
|
118
|
+
type: 'USB',
|
|
119
|
+
name: subdisk._name || '',
|
|
120
|
+
vendor: (0, mappings_1.diskVendorFromModel)(subdisk.manufacturer || subdisk.vendor_id || subdisk._name) || subdisk.manufacturer || '',
|
|
121
|
+
size: media.size_in_bytes,
|
|
122
|
+
bytesPerSector: null,
|
|
123
|
+
totalCylinders: null,
|
|
124
|
+
totalHeads: null,
|
|
125
|
+
totalSectors: null,
|
|
126
|
+
totalTracks: null,
|
|
127
|
+
tracksPerCylinder: null,
|
|
128
|
+
sectorsPerTrack: null,
|
|
129
|
+
firmwareRevision: subdisk.device_revision || '',
|
|
130
|
+
serialNum: subdisk.serial_num || '',
|
|
131
|
+
interfaceType: 'USB',
|
|
132
|
+
smartStatus: subdisk.smart_status === 'verified' ? 'OK' : subdisk.smart_status || 'unknown',
|
|
133
|
+
temperature: null,
|
|
134
|
+
bsdName: media.bsd_name
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (diskLine?.length) {
|
|
144
|
+
const known = new Set(result.map((d) => d.name).filter(Boolean));
|
|
145
|
+
diskLine.forEach((disk) => {
|
|
146
|
+
const pd = disk.physical_drive || {};
|
|
147
|
+
const name = pd.device_name || disk._name || '';
|
|
148
|
+
const bsdName = (disk.bsd_name || '').match(/^disk\d+/)?.[0];
|
|
149
|
+
if (!name || !bsdName || known.has(name)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
known.add(name);
|
|
153
|
+
const smart = (pd.smart_status || '').toLowerCase();
|
|
154
|
+
result.push({
|
|
155
|
+
device: bsdName,
|
|
156
|
+
type: pd.protocol === 'USB' ? 'USB' : pd.medium_type === 'ssd' ? 'SSD' : 'HD',
|
|
157
|
+
name,
|
|
158
|
+
vendor: (0, mappings_1.diskVendorFromModel)(pd.device_name || disk._name),
|
|
159
|
+
size: disk.size_in_bytes,
|
|
160
|
+
bytesPerSector: null,
|
|
161
|
+
totalCylinders: null,
|
|
162
|
+
totalHeads: null,
|
|
163
|
+
totalSectors: null,
|
|
164
|
+
totalTracks: null,
|
|
165
|
+
tracksPerCylinder: null,
|
|
166
|
+
sectorsPerTrack: null,
|
|
167
|
+
firmwareRevision: '',
|
|
168
|
+
serialNum: '',
|
|
169
|
+
interfaceType: pd.protocol || '',
|
|
170
|
+
smartStatus: smart === 'verified' ? 'OK' : smart || 'unknown',
|
|
171
|
+
temperature: null,
|
|
172
|
+
bsdName
|
|
173
|
+
});
|
|
174
|
+
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${bsdName};`;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
({ stdout } = await (0, exec_1.execSave)(cmdFullSmart, { maxBuffer: const_1.MAX_BUFFER_SIZE }));
|
|
179
|
+
const data = JSON.parse(`[${stdout}]`);
|
|
180
|
+
data.forEach((disk) => {
|
|
181
|
+
const bsdName = disk.smartctl.argv[disk.smartctl.argv.length - 1];
|
|
182
|
+
for (let i = 0; i < result.length; i++) {
|
|
183
|
+
if (result[i].bsdName === bsdName) {
|
|
184
|
+
result[i].smartStatus = disk.smart_status.passed ? 'Ok' : disk.smart_status.passed === false ? 'Predicted Failure' : 'unknown';
|
|
185
|
+
if (disk.temperature && disk.temperature.current) {
|
|
186
|
+
result[i].temperature = disk.temperature.current;
|
|
187
|
+
}
|
|
188
|
+
result[i].smartData = disk;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
cmd = '';
|
|
193
|
+
}
|
|
194
|
+
catch { }
|
|
195
|
+
if (cmd) {
|
|
196
|
+
cmd = cmd + 'printf "\n"';
|
|
197
|
+
try {
|
|
198
|
+
({ stdout } = await (0, exec_1.exec)(cmd, { maxBuffer: const_1.MAX_BUFFER_SIZE }));
|
|
199
|
+
const lines = stdout.split('\n');
|
|
200
|
+
lines.forEach((line) => {
|
|
201
|
+
if (line) {
|
|
202
|
+
const parts = line.split('|');
|
|
203
|
+
if (parts.length === 2) {
|
|
204
|
+
const bsdName = parts[0];
|
|
205
|
+
parts[1] = parts[1].trim();
|
|
206
|
+
const parts2 = parts[1].split(':');
|
|
207
|
+
if (parts2.length === 2) {
|
|
208
|
+
parts2[1] = parts2[1].trim();
|
|
209
|
+
const status = parts2[1].toLowerCase();
|
|
210
|
+
for (let i = 0; i < result.length; i++) {
|
|
211
|
+
if (result[i].bsdName === bsdName) {
|
|
212
|
+
result[i].smartStatus = status === 'passed' ? 'Ok' : status === 'failed!' ? 'Predicted Failure' : 'unknown';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
catch { }
|
|
221
|
+
}
|
|
222
|
+
for (let i = 0; i < result.length; i++) {
|
|
223
|
+
delete result[i].bsdName;
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
return [];
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
exports.diskLayout = diskLayout;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disksIO = void 0;
|
|
4
|
+
const defaults_1 = require("../common/defaults");
|
|
5
|
+
const index_1 = require("../common/index");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const filesys_1 = require("../common/filesys");
|
|
9
|
+
const const_1 = require("../common/const");
|
|
10
|
+
const disksIO = async () => {
|
|
11
|
+
await (0, common_1.nextTick)();
|
|
12
|
+
if ((filesys_1._disk_io && !filesys_1._disk_io.ms) || (filesys_1._disk_io && filesys_1._disk_io.ms && Date.now() - filesys_1._disk_io.ms >= 500)) {
|
|
13
|
+
const defaults = (0, index_1.cloneObj)(defaults_1.initDiskIo);
|
|
14
|
+
let rIO = 0;
|
|
15
|
+
let wIO = 0;
|
|
16
|
+
const rWaitTime = 0;
|
|
17
|
+
const wWaitTime = 0;
|
|
18
|
+
const tWaitTime = 0;
|
|
19
|
+
try {
|
|
20
|
+
const { stdout } = await (0, exec_1.exec)('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', {
|
|
21
|
+
maxBuffer: const_1.MAX_BUFFER_SIZE
|
|
22
|
+
});
|
|
23
|
+
const lines = stdout.toString().split('\n');
|
|
24
|
+
lines.forEach(function (line) {
|
|
25
|
+
line = line.trim();
|
|
26
|
+
if (line !== '') {
|
|
27
|
+
const lineParts = line.split(',');
|
|
28
|
+
rIO += (0, common_1.toInt)(lineParts[10]);
|
|
29
|
+
wIO += (0, common_1.toInt)(lineParts[0]);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return (0, filesys_1.calcDiskIO)(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return defaults;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return {
|
|
40
|
+
rIO: filesys_1._disk_io.rIO,
|
|
41
|
+
wIO: filesys_1._disk_io.wIO,
|
|
42
|
+
tIO: filesys_1._disk_io.rIO + filesys_1._disk_io.wIO,
|
|
43
|
+
ms: filesys_1._disk_io.last_ms,
|
|
44
|
+
rIO_sec: filesys_1._disk_io.rIO_sec,
|
|
45
|
+
wIO_sec: filesys_1._disk_io.wIO_sec,
|
|
46
|
+
tIO_sec: filesys_1._disk_io.tIO_sec,
|
|
47
|
+
rWaitTime: filesys_1._disk_io.rWaitTime,
|
|
48
|
+
wWaitTime: filesys_1._disk_io.wWaitTime,
|
|
49
|
+
tWaitTime: filesys_1._disk_io.tWaitTime,
|
|
50
|
+
rWaitPercent: filesys_1._disk_io.rWaitPercent,
|
|
51
|
+
wWaitPercent: filesys_1._disk_io.wWaitPercent,
|
|
52
|
+
tWaitPercent: filesys_1._disk_io.tWaitPercent
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.disksIO = disksIO;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displays = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const darwin_1 = require("../common/darwin");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const mappings_1 = require("../common/mappings");
|
|
8
|
+
const parseDisplaysDarwin = (graphicsArr) => {
|
|
9
|
+
const displays = [];
|
|
10
|
+
try {
|
|
11
|
+
graphicsArr.forEach((item) => {
|
|
12
|
+
if (item.spdisplays_ndrvs && item.spdisplays_ndrvs.length) {
|
|
13
|
+
item.spdisplays_ndrvs.forEach((displayItem) => {
|
|
14
|
+
const connectionType = displayItem['spdisplays_connection_type'] || '';
|
|
15
|
+
const currentResolutionParts = (displayItem['_spdisplays_resolution'] || '').split('@');
|
|
16
|
+
const currentResolution = currentResolutionParts[0].split('x');
|
|
17
|
+
const pixelParts = (displayItem['_spdisplays_pixels'] || '').split('x');
|
|
18
|
+
const pixelDepthString = displayItem['spdisplays_depth'] || '';
|
|
19
|
+
const serial = displayItem['_spdisplays_display-serial-number'] || displayItem['_spdisplays_display-serial-number2'] || null;
|
|
20
|
+
displays.push({
|
|
21
|
+
vendor: (0, mappings_1.graphicsIdToVendor)(displayItem['_spdisplays_display-vendor-id'] || '') || (0, mappings_1.graphicsModelToVendor)(displayItem['_name'] || ''),
|
|
22
|
+
vendorId: displayItem['_spdisplays_display-vendor-id'] || '',
|
|
23
|
+
model: displayItem['_name'] || '',
|
|
24
|
+
productionYear: (0, common_1.toInt)(displayItem['_spdisplays_display-year']) || null,
|
|
25
|
+
serial: serial !== '0' ? serial : null,
|
|
26
|
+
displayId: displayItem['_spdisplays_displayID'] || null,
|
|
27
|
+
deviceName: null,
|
|
28
|
+
main: displayItem['spdisplays_main'] ? displayItem['spdisplays_main'] === 'spdisplays_yes' : false,
|
|
29
|
+
builtin: (displayItem['spdisplays_display_type'] || '').indexOf('built-in') > -1,
|
|
30
|
+
connection: connectionType.indexOf('_internal') > -1 ? 'Internal' : connectionType.indexOf('_displayport') > -1 ? 'Display Port' : connectionType.indexOf('_hdmi') > -1 ? 'HDMI' : null,
|
|
31
|
+
sizeX: null,
|
|
32
|
+
sizeY: null,
|
|
33
|
+
pixelDepth: pixelDepthString === 'CGSThirtyBitColor' ? 30 : pixelDepthString === 'CGSThirtytwoBitColor' ? 32 : pixelDepthString === 'CGSTwentyfourBitColor' ? 24 : null,
|
|
34
|
+
resolutionX: pixelParts.length > 1 ? parseInt(pixelParts[0], 10) : null,
|
|
35
|
+
resolutionY: pixelParts.length > 1 ? parseInt(pixelParts[1], 10) : null,
|
|
36
|
+
currentResX: currentResolution.length > 1 ? parseInt(currentResolution[0], 10) : null,
|
|
37
|
+
currentResY: currentResolution.length > 1 ? parseInt(currentResolution[1], 10) : null,
|
|
38
|
+
positionX: 0,
|
|
39
|
+
positionY: 0,
|
|
40
|
+
currentRefreshRate: currentResolutionParts.length > 1 ? parseInt(currentResolutionParts[1], 10) : null
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
return displays;
|
|
48
|
+
};
|
|
49
|
+
const getDisplayPositionDarwin = async (displays) => {
|
|
50
|
+
try {
|
|
51
|
+
const { stdout } = await (0, exec_1.exec)('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""', { maxBuffer: 1024 * 20000 });
|
|
52
|
+
const output = (stdout || '').toString();
|
|
53
|
+
const obj = (0, darwin_1.plistReader)(output);
|
|
54
|
+
if (obj.DisplayAnyUserSets && obj.DisplayAnyUserSets.Configs && obj.DisplayAnyUserSets.Configs[0] && obj.DisplayAnyUserSets.Configs[0].DisplayConfig) {
|
|
55
|
+
const current = obj.DisplayAnyUserSets.Configs[0].DisplayConfig;
|
|
56
|
+
let i = 0;
|
|
57
|
+
current.forEach((o) => {
|
|
58
|
+
if (o.CurrentInfo && o.CurrentInfo.OriginX !== undefined && displays[i]) {
|
|
59
|
+
displays[i].positionX = o.CurrentInfo.OriginX;
|
|
60
|
+
}
|
|
61
|
+
if (o.CurrentInfo && o.CurrentInfo.OriginY !== undefined && displays[i]) {
|
|
62
|
+
displays[i].positionY = o.CurrentInfo.OriginY;
|
|
63
|
+
}
|
|
64
|
+
i++;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (obj.DisplayAnyUserSets && obj.DisplayAnyUserSets.length > 0 && obj.DisplayAnyUserSets[0].length > 0 && obj.DisplayAnyUserSets[0][0].DisplayID) {
|
|
68
|
+
const current = obj.DisplayAnyUserSets[0];
|
|
69
|
+
let i = 0;
|
|
70
|
+
current.forEach((o) => {
|
|
71
|
+
if ('OriginX' in o && displays[i]) {
|
|
72
|
+
displays[i].positionX = o.OriginX;
|
|
73
|
+
}
|
|
74
|
+
if ('OriginY' in o && displays[i]) {
|
|
75
|
+
displays[i].positionY = o.OriginY;
|
|
76
|
+
}
|
|
77
|
+
if (o['Mode'] && o.Mode.BitsPerPixel !== undefined && displays[i]) {
|
|
78
|
+
displays[i].pixelDepth = o.Mode.BitsPerPixel;
|
|
79
|
+
}
|
|
80
|
+
i++;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch { }
|
|
85
|
+
return displays;
|
|
86
|
+
};
|
|
87
|
+
const displays = async () => {
|
|
88
|
+
await (0, common_1.nextTick)();
|
|
89
|
+
let result = [];
|
|
90
|
+
try {
|
|
91
|
+
const { stdout } = await (0, exec_1.shareInflight)('SPDisplaysDataType', () => (0, exec_1.exec)('system_profiler -xml -detailLevel full SPDisplaysDataType'));
|
|
92
|
+
result = parseDisplaysDarwin((0, darwin_1.plistParser)(stdout));
|
|
93
|
+
result = await getDisplayPositionDarwin(result);
|
|
94
|
+
}
|
|
95
|
+
catch { }
|
|
96
|
+
return result;
|
|
97
|
+
};
|
|
98
|
+
exports.displays = displays;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fsOpenFiles = void 0;
|
|
4
|
+
const defaults_1 = require("../common/defaults");
|
|
5
|
+
const index_1 = require("../common/index");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const const_1 = require("../common/const");
|
|
9
|
+
const fsOpenFiles = async () => {
|
|
10
|
+
await (0, common_1.nextTick)();
|
|
11
|
+
try {
|
|
12
|
+
const { stdout, stderr } = await (0, exec_1.exec)('sysctl -i kern.maxfiles kern.num_files kern.open_files', { maxBuffer: const_1.MAX_BUFFER_SIZE });
|
|
13
|
+
if (!stderr) {
|
|
14
|
+
const lines = stdout.split('\n');
|
|
15
|
+
const max = (0, common_1.toInt)((0, common_1.getValue)(lines, 'kern.maxfiles', ':'));
|
|
16
|
+
const allocated = (0, common_1.toInt)((0, common_1.getValue)(lines, 'kern.num_files', ':')) || (0, common_1.toInt)((0, common_1.getValue)(lines, 'kern.open_files', ':'));
|
|
17
|
+
return {
|
|
18
|
+
max,
|
|
19
|
+
allocated,
|
|
20
|
+
available: max - allocated
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch { }
|
|
25
|
+
return (0, index_1.cloneObj)(defaults_1.initFsOpenFiles);
|
|
26
|
+
};
|
|
27
|
+
exports.fsOpenFiles = fsOpenFiles;
|