systeminformation 5.33.5 → 6.0.0-beta.1
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 -958
- 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 +24 -0
- package/dist/bsd/os-info.js +47 -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/acceleration.d.ts +8 -0
- package/dist/common/acceleration.js +86 -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 +304 -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 +6 -0
- package/dist/common/internet.js +92 -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 +1024 -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 +2 -0
- package/dist/darwin/os-info.js +140 -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 +60 -0
- package/dist/index.js +132 -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/inet-public-ip.d.ts +2 -0
- package/dist/inet-public-ip.js +10 -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 +15 -0
- package/dist/linux/gpu.js +383 -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 +114 -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 +1150 -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 +3 -0
- package/dist/windows/block-devices.js +58 -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 +129 -0
- package/dist/windows/disks-io.d.ts +2 -0
- package/dist/windows/disks-io.js +46 -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 +70 -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 -1849
- 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 -1322
- 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 -2833
- package/lib/virtualbox.js +0 -116
- package/lib/wifi.js +0 -839
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { npm } from '../npm';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.npu = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const windows_1 = require("../common/windows");
|
|
7
|
+
const NPU_MATCH = /neural|\bnpu\b|ai boost|xdna|hexagon|ai accelerator|compute accelerator|ipu device/i;
|
|
8
|
+
const matchId = (deviceId, key) => {
|
|
9
|
+
const match = deviceId.match(new RegExp(`${key}_([0-9A-Fa-f]{4})`));
|
|
10
|
+
return match ? match[1].toLowerCase() : '';
|
|
11
|
+
};
|
|
12
|
+
const npu = async () => {
|
|
13
|
+
await (0, common_1.nextTick)();
|
|
14
|
+
const devices = (0, windows_1.psArray)(await windows_1.ps.exec('@(Get-CimInstance Win32_PnPEntity | Select-Object Name,DeviceID,Manufacturer,Service) | ConvertTo-Json -Depth 3'));
|
|
15
|
+
return devices
|
|
16
|
+
.filter((data) => NPU_MATCH.test(data.Name || ''))
|
|
17
|
+
.map((data) => {
|
|
18
|
+
const deviceId = data.DeviceID || '';
|
|
19
|
+
return {
|
|
20
|
+
...(0, common_1.cloneObj)(defaults_1.initNpuData),
|
|
21
|
+
vendor: (data.Manufacturer || '').trim(),
|
|
22
|
+
name: (data.Name || '').trim(),
|
|
23
|
+
vendorId: matchId(deviceId, 'VEN'),
|
|
24
|
+
deviceId: matchId(deviceId, 'DEV'),
|
|
25
|
+
driver: data.Service || ''
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.npu = npu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const osInfo: () => Promise<import("../common/types").OsData>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.osInfo = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const codepage_1 = require("../common/codepage");
|
|
6
|
+
const defaults_1 = require("../common/defaults");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const windows_1 = require("../common/windows");
|
|
10
|
+
const windowsIsUefi = async () => {
|
|
11
|
+
try {
|
|
12
|
+
const { stdout } = await (0, exec_1.exec)('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"');
|
|
13
|
+
const line = stdout.split('\n\r')[0];
|
|
14
|
+
return line.toLowerCase().indexOf('efi') >= 0;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
const { stdout } = await (0, exec_1.exec)('echo %firmware_type%');
|
|
18
|
+
const line = stdout.toString() || '';
|
|
19
|
+
return line.toLowerCase().indexOf('efi') >= 0;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const osInfo = async () => {
|
|
23
|
+
await (0, common_1.nextTick)();
|
|
24
|
+
const result = await (0, defaults_1.initOsInfo)();
|
|
25
|
+
try {
|
|
26
|
+
result.logofile = (0, mappings_1.getLogoFile)();
|
|
27
|
+
result.release = result.kernel;
|
|
28
|
+
const workload = [];
|
|
29
|
+
workload.push(windows_1.ps.exec('Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl'));
|
|
30
|
+
workload.push(windows_1.ps.exec('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
|
31
|
+
workload.push(windows_1.ps.exec('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));
|
|
32
|
+
workload.push(windows_1.ps.exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /v DisplayVersion'));
|
|
33
|
+
workload.push(windows_1.ps.exec("(Get-CimInstance Win32_OperatingSystem).InstallDate.ToString('yyyy-MM-ddTHH:mm:ss')"));
|
|
34
|
+
workload.push(windows_1.ps.exec('[bool](Get-Process dwm -ErrorAction SilentlyContinue)'));
|
|
35
|
+
workload.push(windows_1.ps.exec("Get-HotFix | Where-Object { $_.Description -match 'Update' } | Sort-Object InstalledOn -Descending | Select-Object -First 1 -ExpandProperty InstalledOn | ForEach-Object { $_.ToString('yyyy-MM-ddTHH:mm:ss') }"));
|
|
36
|
+
const data = await Promise.allSettled(workload).then((results) => results.map((result) => (result.status === 'fulfilled' ? result.value : null)));
|
|
37
|
+
const lines = data[0] ? data[0].toString().split('\r\n') : [''];
|
|
38
|
+
result.distro = (0, common_1.getValue)(lines, 'Caption', ':').trim();
|
|
39
|
+
result.serial = (0, common_1.getValue)(lines, 'SerialNumber', ':').trim();
|
|
40
|
+
result.build = (0, common_1.getValue)(lines, 'BuildNumber', ':').trim();
|
|
41
|
+
result.servicepack = `${(0, common_1.getValue)(lines, 'ServicePackMajorVersion', ':').trim()}.${(0, common_1.getValue)(lines, 'ServicePackMinorVersion', ':').trim()}`;
|
|
42
|
+
result.codepage = (0, codepage_1.getCodepage)();
|
|
43
|
+
const hyperv = data[1] ? data[1].toString().toLowerCase() : '';
|
|
44
|
+
result.hypervisor = hyperv.indexOf('true') !== -1;
|
|
45
|
+
const term = data[2] ? data[2].toString() : '';
|
|
46
|
+
if (data[3]) {
|
|
47
|
+
const codenameParts = data[3].split('REG_SZ');
|
|
48
|
+
result.codename = codenameParts.length > 1 ? codenameParts[1].trim() : '';
|
|
49
|
+
}
|
|
50
|
+
if (!result.codename) {
|
|
51
|
+
const buildNum = parseInt(result.build, 10);
|
|
52
|
+
result.codename = (0, mappings_1.getWindowsRelease)(buildNum);
|
|
53
|
+
}
|
|
54
|
+
result.remoteSession = term.toString().toLowerCase().indexOf('true') >= 0;
|
|
55
|
+
const uefi = await windowsIsUefi();
|
|
56
|
+
result.uefi = uefi;
|
|
57
|
+
if (data[4]) {
|
|
58
|
+
const installDate = new Date(data[4].toString().trim());
|
|
59
|
+
result.installDate = Number.isNaN(installDate.getTime()) ? null : installDate;
|
|
60
|
+
}
|
|
61
|
+
result.displayServer = data[5] && data[5].toString().toLowerCase().indexOf('true') >= 0 ? 'dwm' : '';
|
|
62
|
+
if (data[6]) {
|
|
63
|
+
const lastUpdate = new Date(data[6].toString().trim());
|
|
64
|
+
result.lastUpdate = Number.isNaN(lastUpdate.getTime()) ? null : lastUpdate;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch { }
|
|
68
|
+
return result;
|
|
69
|
+
};
|
|
70
|
+
exports.osInfo = osInfo;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pci = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const windows_1 = require("../common/windows");
|
|
7
|
+
const matchId = (deviceId, key, len) => {
|
|
8
|
+
const match = deviceId.match(new RegExp(`${key}_([0-9A-Fa-f]{${len}})`));
|
|
9
|
+
return match ? match[1].toLowerCase() : '';
|
|
10
|
+
};
|
|
11
|
+
const parsePci = (devices) => (devices || []).map((data) => {
|
|
12
|
+
const deviceId = data.DeviceID || '';
|
|
13
|
+
const subsys = matchId(deviceId, 'SUBSYS', 8);
|
|
14
|
+
return {
|
|
15
|
+
...(0, common_1.cloneObj)(defaults_1.initPciData),
|
|
16
|
+
slot: '',
|
|
17
|
+
type: data.PNPClass || '',
|
|
18
|
+
vendor: (data.Manufacturer || '').trim(),
|
|
19
|
+
vendorId: matchId(deviceId, 'VEN', 4),
|
|
20
|
+
model: (data.Name || '').trim(),
|
|
21
|
+
deviceId: matchId(deviceId, 'DEV', 4),
|
|
22
|
+
subVendorId: subsys ? subsys.slice(4, 8) : '',
|
|
23
|
+
subDeviceId: subsys ? subsys.slice(0, 4) : '',
|
|
24
|
+
revision: matchId(deviceId, 'REV', 2),
|
|
25
|
+
driver: data.Service || ''
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const pci = async () => {
|
|
29
|
+
await (0, common_1.nextTick)();
|
|
30
|
+
const devices = (0, windows_1.psArray)(await windows_1.ps.exec("@(Get-CimInstance Win32_PnPEntity | Where-Object { $_.DeviceID -like 'PCI*' } | Select-Object Name,DeviceID,Manufacturer,Service,PNPClass) | ConvertTo-Json -Depth 3"));
|
|
31
|
+
return parsePci(devices);
|
|
32
|
+
};
|
|
33
|
+
exports.pci = pci;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printer = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const mappings_1 = require("../common/mappings");
|
|
6
|
+
const windows_1 = require("../common/windows");
|
|
7
|
+
const parsePrinters = (lines, id) => {
|
|
8
|
+
const status = parseInt((0, common_1.getValue)(lines, 'PrinterStatus', ':'), 10);
|
|
9
|
+
return {
|
|
10
|
+
id: id,
|
|
11
|
+
name: (0, common_1.getValue)(lines, 'name', ':'),
|
|
12
|
+
model: (0, common_1.getValue)(lines, 'DriverName', ':'),
|
|
13
|
+
uri: null,
|
|
14
|
+
uuid: null,
|
|
15
|
+
status: mappings_1.winPrinterStatus[status] ? mappings_1.winPrinterStatus[status] : null,
|
|
16
|
+
local: (0, common_1.getValue)(lines, 'Local', ':').toUpperCase() === 'TRUE',
|
|
17
|
+
default: (0, common_1.getValue)(lines, 'Default', ':').toUpperCase() === 'TRUE',
|
|
18
|
+
shared: (0, common_1.getValue)(lines, 'Shared', ':').toUpperCase() === 'TRUE',
|
|
19
|
+
engine: null,
|
|
20
|
+
engineVersion: null
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const printer = async () => {
|
|
24
|
+
await (0, common_1.nextTick)();
|
|
25
|
+
const result = [];
|
|
26
|
+
const stdout = await windows_1.ps.exec('Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl');
|
|
27
|
+
const parts = stdout.toString().split(/\n\s*\n/);
|
|
28
|
+
for (let i = 0; i < parts.length; i++) {
|
|
29
|
+
const printer = parsePrinters(parts[i].split('\n'), i);
|
|
30
|
+
if (printer.name || printer.model) {
|
|
31
|
+
result.push(printer);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
exports.printer = printer;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processLoad = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const security_1 = require("../common/security");
|
|
7
|
+
const windows_1 = require("../common/windows");
|
|
8
|
+
const processes_1 = require("./processes");
|
|
9
|
+
const _process_cpu = {
|
|
10
|
+
all: 0,
|
|
11
|
+
all_utime: 0,
|
|
12
|
+
all_stime: 0,
|
|
13
|
+
list: {},
|
|
14
|
+
ms: 0,
|
|
15
|
+
result: {}
|
|
16
|
+
};
|
|
17
|
+
const processLoad = async (proc) => {
|
|
18
|
+
await (0, common_1.nextTick)();
|
|
19
|
+
const result = [];
|
|
20
|
+
if (!(0, security_1.isPrototypePolluted)()) {
|
|
21
|
+
const processes = (0, security_1.sanitizeServiceString)(proc);
|
|
22
|
+
if (processes.length) {
|
|
23
|
+
try {
|
|
24
|
+
const processArray = (0, windows_1.psArray)(await windows_1.ps.exec('Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | ConvertTo-Json -compress'));
|
|
25
|
+
const procStats = [];
|
|
26
|
+
const list_new = {};
|
|
27
|
+
let allcpuu = 0;
|
|
28
|
+
let allcpus = 0;
|
|
29
|
+
processArray.forEach((element) => {
|
|
30
|
+
const pid = element.ProcessId;
|
|
31
|
+
const name = element.Caption;
|
|
32
|
+
const utime = element.UserModeTime;
|
|
33
|
+
const stime = element.KernelModeTime;
|
|
34
|
+
const mem = element.WorkingSetSize;
|
|
35
|
+
allcpuu = allcpuu + utime;
|
|
36
|
+
allcpus = allcpus + stime;
|
|
37
|
+
procStats.push({
|
|
38
|
+
pid: pid,
|
|
39
|
+
name,
|
|
40
|
+
utime: utime,
|
|
41
|
+
stime: stime,
|
|
42
|
+
cpu: 0,
|
|
43
|
+
cpuu: 0,
|
|
44
|
+
cpus: 0,
|
|
45
|
+
mem
|
|
46
|
+
});
|
|
47
|
+
let pname = '';
|
|
48
|
+
let inList = false;
|
|
49
|
+
processes.forEach((proc) => {
|
|
50
|
+
if (name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {
|
|
51
|
+
inList = true;
|
|
52
|
+
pname = proc;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
if ((processes.length === 1 && processes[0] === '*') || inList) {
|
|
56
|
+
let processFound = false;
|
|
57
|
+
result.forEach((item) => {
|
|
58
|
+
if (item.proc.toLowerCase() === pname.toLowerCase()) {
|
|
59
|
+
item.pids.push(pid);
|
|
60
|
+
item.mem += (mem / (0, node_os_1.totalmem)()) * 100;
|
|
61
|
+
processFound = true;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (!processFound) {
|
|
65
|
+
result.push({
|
|
66
|
+
proc: pname,
|
|
67
|
+
pid: pid,
|
|
68
|
+
pids: [pid],
|
|
69
|
+
cpu: 0,
|
|
70
|
+
mem: (mem / (0, node_os_1.totalmem)()) * 100
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
if (processes.length !== 1 || processes[0] !== '*') {
|
|
76
|
+
const processesMissing = processes.filter((name) => {
|
|
77
|
+
return (procStats.filter((item) => {
|
|
78
|
+
return item.name.toLowerCase().indexOf(name) >= 0;
|
|
79
|
+
}).length === 0);
|
|
80
|
+
});
|
|
81
|
+
processesMissing.forEach((procName) => {
|
|
82
|
+
result.push({
|
|
83
|
+
proc: procName,
|
|
84
|
+
pid: null,
|
|
85
|
+
pids: [],
|
|
86
|
+
cpu: 0,
|
|
87
|
+
mem: 0
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
procStats.forEach((element) => {
|
|
92
|
+
const resultProcess = (0, processes_1.calcProcStatWin)(element, allcpuu + allcpus, _process_cpu);
|
|
93
|
+
let listPos = -1;
|
|
94
|
+
for (let j = 0; j < result.length; j++) {
|
|
95
|
+
if (result[j].pid === resultProcess.pid || result[j].pids.indexOf(resultProcess.pid) >= 0) {
|
|
96
|
+
listPos = j;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (listPos >= 0) {
|
|
100
|
+
result[listPos].cpu += resultProcess.cpuu + resultProcess.cpus;
|
|
101
|
+
}
|
|
102
|
+
list_new[resultProcess.pid] = {
|
|
103
|
+
cpuu: resultProcess.cpuu,
|
|
104
|
+
cpus: resultProcess.cpus,
|
|
105
|
+
utime: resultProcess.utime,
|
|
106
|
+
stime: resultProcess.stime
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
_process_cpu.all = allcpuu + allcpus;
|
|
110
|
+
_process_cpu.all_utime = allcpuu;
|
|
111
|
+
_process_cpu.all_stime = allcpus;
|
|
112
|
+
_process_cpu.list = Object.assign({}, list_new);
|
|
113
|
+
_process_cpu.ms = Date.now();
|
|
114
|
+
_process_cpu.result = JSON.parse(JSON.stringify(result));
|
|
115
|
+
}
|
|
116
|
+
catch { }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
};
|
|
121
|
+
exports.processLoad = processLoad;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CpuData, ProcessesData, ProcStatData } from '../common/types';
|
|
2
|
+
export declare const calcProcStatWin: (procStat: ProcStatData, all: number, _cpu_old: CpuData) => {
|
|
3
|
+
pid: number;
|
|
4
|
+
utime: number;
|
|
5
|
+
stime: number;
|
|
6
|
+
cpuu: number;
|
|
7
|
+
cpus: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const processes: () => Promise<ProcessesData>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processes = exports.calcProcStatWin = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const defaults_1 = require("../common/defaults");
|
|
7
|
+
const mappings_1 = require("../common/mappings");
|
|
8
|
+
const windows_1 = require("../common/windows");
|
|
9
|
+
const _processes_cpu = {
|
|
10
|
+
all: 0,
|
|
11
|
+
all_utime: 0,
|
|
12
|
+
all_stime: 0,
|
|
13
|
+
list: {},
|
|
14
|
+
ms: 0,
|
|
15
|
+
result: {}
|
|
16
|
+
};
|
|
17
|
+
const calcProcStatWin = (procStat, all, _cpu_old) => {
|
|
18
|
+
let cpuu = 0;
|
|
19
|
+
let cpus = 0;
|
|
20
|
+
if (_cpu_old.all > 0 && _cpu_old.list[procStat.pid]) {
|
|
21
|
+
cpuu = ((procStat.utime - _cpu_old.list[procStat.pid].utime) / (all - _cpu_old.all)) * 100;
|
|
22
|
+
cpus = ((procStat.stime - _cpu_old.list[procStat.pid].stime) / (all - _cpu_old.all)) * 100;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
cpuu = (procStat.utime / all) * 100;
|
|
26
|
+
cpus = (procStat.stime / all) * 100;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
pid: procStat.pid,
|
|
30
|
+
utime: procStat.utime,
|
|
31
|
+
stime: procStat.stime,
|
|
32
|
+
cpuu: cpuu > 0 ? cpuu : 0,
|
|
33
|
+
cpus: cpus > 0 ? cpus : 0
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.calcProcStatWin = calcProcStatWin;
|
|
37
|
+
const processes = async () => {
|
|
38
|
+
await (0, common_1.nextTick)();
|
|
39
|
+
const result = (0, common_1.cloneObj)(defaults_1.initProcesses);
|
|
40
|
+
if ((_processes_cpu.ms && Date.now() - _processes_cpu.ms >= 500) || _processes_cpu.ms === 0) {
|
|
41
|
+
try {
|
|
42
|
+
const processArray = (0, windows_1.psArray)(await windows_1.ps.exec(`Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,
|
|
43
|
+
@{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | ConvertTo-Json -compress`));
|
|
44
|
+
if (processArray.length) {
|
|
45
|
+
const procs = [];
|
|
46
|
+
const procStats = [];
|
|
47
|
+
const list_new = {};
|
|
48
|
+
let allcpuu = 0;
|
|
49
|
+
let allcpus = 0;
|
|
50
|
+
processArray.forEach((element) => {
|
|
51
|
+
const pid = element.ProcessId;
|
|
52
|
+
const parentPid = element.ParentProcessId;
|
|
53
|
+
const statusValue = element.ExecutionState || null;
|
|
54
|
+
const name = element.Caption;
|
|
55
|
+
const commandLine = element.CommandLine;
|
|
56
|
+
const commandPath = element.ExecutablePath;
|
|
57
|
+
const utime = element.UserModeTime;
|
|
58
|
+
const stime = element.KernelModeTime;
|
|
59
|
+
const memw = element.WorkingSetSize;
|
|
60
|
+
allcpuu = allcpuu + utime;
|
|
61
|
+
allcpus = allcpus + stime;
|
|
62
|
+
result.all++;
|
|
63
|
+
if (!statusValue) {
|
|
64
|
+
result.unknown++;
|
|
65
|
+
}
|
|
66
|
+
if (statusValue === 3) {
|
|
67
|
+
result.running++;
|
|
68
|
+
}
|
|
69
|
+
if (statusValue === 4 || statusValue === 5) {
|
|
70
|
+
result.blocked++;
|
|
71
|
+
}
|
|
72
|
+
procStats.push({
|
|
73
|
+
pid: pid,
|
|
74
|
+
name: '',
|
|
75
|
+
utime: utime,
|
|
76
|
+
stime: stime,
|
|
77
|
+
cpu: 0,
|
|
78
|
+
cpuu: 0,
|
|
79
|
+
cpus: 0
|
|
80
|
+
});
|
|
81
|
+
procs.push({
|
|
82
|
+
pid: pid,
|
|
83
|
+
parentPid: parentPid,
|
|
84
|
+
name: name,
|
|
85
|
+
cpu: 0,
|
|
86
|
+
cpuu: 0,
|
|
87
|
+
cpus: 0,
|
|
88
|
+
mem: (memw / (0, node_os_1.totalmem)()) * 100,
|
|
89
|
+
priority: element.Priority || 0,
|
|
90
|
+
memVsz: element.PageFileUsage || null,
|
|
91
|
+
memRss: Math.floor((element.WorkingSetSize || 0) / 1024),
|
|
92
|
+
nice: 0,
|
|
93
|
+
started: element.CreationDate,
|
|
94
|
+
state: statusValue ? mappings_1.winProcessStatus[statusValue] : mappings_1.winProcessStatus[0],
|
|
95
|
+
tty: '',
|
|
96
|
+
user: '',
|
|
97
|
+
command: commandLine || name,
|
|
98
|
+
path: commandPath,
|
|
99
|
+
params: ''
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
result.sleeping = result.all - result.running - result.blocked - result.unknown;
|
|
103
|
+
result.list = procs;
|
|
104
|
+
procStats.forEach((element) => {
|
|
105
|
+
const resultProcess = (0, exports.calcProcStatWin)(element, allcpuu + allcpus, _processes_cpu);
|
|
106
|
+
const listPos = result.list
|
|
107
|
+
.map((e) => {
|
|
108
|
+
return e.pid;
|
|
109
|
+
})
|
|
110
|
+
.indexOf(resultProcess.pid);
|
|
111
|
+
if (listPos >= 0) {
|
|
112
|
+
result.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus;
|
|
113
|
+
result.list[listPos].cpuu = resultProcess.cpuu;
|
|
114
|
+
result.list[listPos].cpus = resultProcess.cpus;
|
|
115
|
+
}
|
|
116
|
+
list_new[resultProcess.pid] = {
|
|
117
|
+
cpuu: resultProcess.cpuu,
|
|
118
|
+
cpus: resultProcess.cpus,
|
|
119
|
+
utime: resultProcess.utime,
|
|
120
|
+
stime: resultProcess.stime
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
_processes_cpu.all = allcpuu + allcpus;
|
|
124
|
+
_processes_cpu.all_utime = allcpuu;
|
|
125
|
+
_processes_cpu.all_stime = allcpus;
|
|
126
|
+
_processes_cpu.list = Object.assign({}, list_new);
|
|
127
|
+
_processes_cpu.ms = Date.now();
|
|
128
|
+
_processes_cpu.result = Object.assign({}, result);
|
|
129
|
+
}
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
catch { }
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return _processes_cpu.result;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
exports.processes = processes;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.services = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const security_1 = require("../common/security");
|
|
6
|
+
const windows_1 = require("../common/windows");
|
|
7
|
+
const services = async (srv) => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
const result = [];
|
|
10
|
+
if (!(0, security_1.isPrototypePolluted)()) {
|
|
11
|
+
const srvs = (0, security_1.sanitizeServiceString)(srv);
|
|
12
|
+
const dataSrv = [];
|
|
13
|
+
try {
|
|
14
|
+
let wincommand = 'Get-CimInstance Win32_Service';
|
|
15
|
+
if (srvs[0] !== '*') {
|
|
16
|
+
wincommand += ' -Filter "';
|
|
17
|
+
srvs.forEach((srv) => {
|
|
18
|
+
wincommand += `Name='${srv}' or `;
|
|
19
|
+
});
|
|
20
|
+
wincommand = `${wincommand.slice(0, -4)}"`;
|
|
21
|
+
}
|
|
22
|
+
wincommand += ' | select Name,Caption,Started,StartMode,ProcessId | fl';
|
|
23
|
+
const stdout = await windows_1.ps.exec(wincommand);
|
|
24
|
+
if (stdout) {
|
|
25
|
+
const serviceSections = stdout.split(/\n\s*\n/);
|
|
26
|
+
serviceSections.forEach((element) => {
|
|
27
|
+
if (element.trim() !== '') {
|
|
28
|
+
const lines = element.trim().split('\r\n');
|
|
29
|
+
const srvName = (0, common_1.getValue)(lines, 'Name', ':', true).toLowerCase();
|
|
30
|
+
const srvCaption = (0, common_1.getValue)(lines, 'Caption', ':', true).toLowerCase();
|
|
31
|
+
const started = (0, common_1.getValue)(lines, 'Started', ':', true);
|
|
32
|
+
const startMode = (0, common_1.getValue)(lines, 'StartMode', ':', true);
|
|
33
|
+
const pid = (0, common_1.toInt)((0, common_1.getValue)(lines, 'ProcessId', ':', true));
|
|
34
|
+
if ((srvs.length === 1 && srvs[0] === '*') || srvs.indexOf(srvName) >= 0 || srvs.indexOf(srvCaption) >= 0) {
|
|
35
|
+
result.push({
|
|
36
|
+
name: srvName,
|
|
37
|
+
running: started.toLowerCase() === 'true',
|
|
38
|
+
startmode: startMode,
|
|
39
|
+
pids: [pid],
|
|
40
|
+
cpu: 0,
|
|
41
|
+
mem: 0
|
|
42
|
+
});
|
|
43
|
+
dataSrv.push(srvName);
|
|
44
|
+
dataSrv.push(srvCaption);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
if (srvs.length !== 1 || srvs[0] !== '*') {
|
|
49
|
+
const srvsMissing = srvs.filter((e) => {
|
|
50
|
+
return dataSrv.indexOf(e) === -1;
|
|
51
|
+
});
|
|
52
|
+
srvsMissing.forEach((srvName) => {
|
|
53
|
+
result.push({
|
|
54
|
+
name: srvName,
|
|
55
|
+
running: false,
|
|
56
|
+
startmode: '',
|
|
57
|
+
pids: [],
|
|
58
|
+
cpu: 0,
|
|
59
|
+
mem: 0
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
srvs.forEach((srvName) => {
|
|
67
|
+
result.push({
|
|
68
|
+
name: srvName,
|
|
69
|
+
running: false,
|
|
70
|
+
startmode: '',
|
|
71
|
+
pids: [],
|
|
72
|
+
cpu: 0,
|
|
73
|
+
mem: 0
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch { }
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
};
|
|
83
|
+
exports.services = services;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shell: () => Promise<string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shell = void 0;
|
|
4
|
+
const windows_1 = require("../common/windows");
|
|
5
|
+
const shell = async () => {
|
|
6
|
+
let result = 'CMD';
|
|
7
|
+
try {
|
|
8
|
+
const ppid = Number(process.ppid);
|
|
9
|
+
if (Number.isInteger(ppid) && ppid > 0) {
|
|
10
|
+
const stdout = await windows_1.ps.exec(`Get-CimInstance -ClassName Win32_Process | where-object {$_.ProcessId -eq ${ppid} } | select Name`);
|
|
11
|
+
if (stdout && stdout.toString().toLowerCase().indexOf('powershell') >= 0) {
|
|
12
|
+
result = 'PowerShell';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch { }
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
exports.shell = shell;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.software = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const windows_1 = require("../common/windows");
|
|
6
|
+
const parseInstallDate = (value) => {
|
|
7
|
+
const match = ('' + (value || '')).trim().match(/^(\d{4})(\d{2})(\d{2})$/);
|
|
8
|
+
if (!match) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const parsed = new Date(parseInt(match[1], 10), parseInt(match[2], 10) - 1, parseInt(match[3], 10));
|
|
12
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
13
|
+
};
|
|
14
|
+
const parseSoftware = (entries) => {
|
|
15
|
+
const result = [];
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
entries.forEach((data) => {
|
|
18
|
+
const name = ('' + (data.DisplayName || '')).trim();
|
|
19
|
+
if (!name) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const version = ('' + (data.DisplayVersion || '')).trim();
|
|
23
|
+
const key = `${name}|${version}`;
|
|
24
|
+
if (seen.has(key)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
seen.add(key);
|
|
28
|
+
const publisher = ('' + (data.Publisher || '')).trim();
|
|
29
|
+
const wow = ('' + (data.PSPath || '')).toLowerCase().includes('wow6432node');
|
|
30
|
+
result.push({
|
|
31
|
+
name,
|
|
32
|
+
description: '',
|
|
33
|
+
version,
|
|
34
|
+
installDate: parseInstallDate(data.InstallDate),
|
|
35
|
+
architecture: wow ? 'x86' : '',
|
|
36
|
+
source: 'registry',
|
|
37
|
+
path: ('' + (data.InstallLocation || '')).trim(),
|
|
38
|
+
signedBy: publisher ? [publisher] : []
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
const software = async () => {
|
|
44
|
+
await (0, common_1.nextTick)();
|
|
45
|
+
try {
|
|
46
|
+
const result = await windows_1.ps.exec("@(Get-ItemProperty 'HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*','HKLM:\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*','HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*' -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName } | Select-Object DisplayName,DisplayVersion,Publisher,InstallDate,InstallLocation,PSPath) | ConvertTo-Json -Depth 2");
|
|
47
|
+
return parseSoftware((0, windows_1.psArray)(result));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.software = software;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const system: () => Promise<any>;
|