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,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.memLayout = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const const_1 = require("../common/const");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const raspberry_1 = require("../common/raspberry");
|
|
10
|
+
const memLayout = async () => {
|
|
11
|
+
await (0, common_1.nextTick)();
|
|
12
|
+
const result = [];
|
|
13
|
+
try {
|
|
14
|
+
let { stdout } = await (0, exec_1.exec)('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL', const_1.execOptsLinux);
|
|
15
|
+
const devices = stdout.toString().split('Memory Device').splice(1);
|
|
16
|
+
devices.forEach((device) => {
|
|
17
|
+
const lines = device.split('\n');
|
|
18
|
+
const sizeString = (0, common_1.getValue)(lines, 'Size');
|
|
19
|
+
const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;
|
|
20
|
+
let bank = (0, common_1.getValue)(lines, 'Bank Locator');
|
|
21
|
+
if (bank.toLowerCase().indexOf('bad') >= 0) {
|
|
22
|
+
bank = '';
|
|
23
|
+
}
|
|
24
|
+
if (parseInt((0, common_1.getValue)(lines, 'Size'), 10) > 0) {
|
|
25
|
+
const totalWidth = (0, common_1.toInt)((0, common_1.getValue)(lines, 'Total Width'));
|
|
26
|
+
const dataWidth = (0, common_1.toInt)((0, common_1.getValue)(lines, 'Data Width'));
|
|
27
|
+
result.push({
|
|
28
|
+
size,
|
|
29
|
+
bank,
|
|
30
|
+
channel: null,
|
|
31
|
+
type: (0, common_1.getValue)(lines, 'Type:'),
|
|
32
|
+
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
|
|
33
|
+
clockSpeed: (0, common_1.getValue)(lines, 'Configured Clock Speed:')
|
|
34
|
+
? parseInt((0, common_1.getValue)(lines, 'Configured Clock Speed:'), 10)
|
|
35
|
+
: (0, common_1.getValue)(lines, 'Speed:')
|
|
36
|
+
? parseInt((0, common_1.getValue)(lines, 'Speed:'), 10)
|
|
37
|
+
: null,
|
|
38
|
+
formFactor: (0, common_1.getValue)(lines, 'Form Factor:'),
|
|
39
|
+
manufacturer: (0, mappings_1.getMemManufacturer)((0, common_1.getValue)(lines, 'Manufacturer:')),
|
|
40
|
+
partNum: (0, common_1.getValue)(lines, 'Part Number:'),
|
|
41
|
+
serialNum: (0, common_1.getValue)(lines, 'Serial Number:'),
|
|
42
|
+
voltageConfigured: parseFloat((0, common_1.getValue)(lines, 'Configured Voltage:')) || null,
|
|
43
|
+
voltageMin: parseFloat((0, common_1.getValue)(lines, 'Minimum Voltage:')) || null,
|
|
44
|
+
voltageMax: parseFloat((0, common_1.getValue)(lines, 'Maximum Voltage:')) || null
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
result.push({
|
|
49
|
+
size: 0,
|
|
50
|
+
bank,
|
|
51
|
+
channel: null,
|
|
52
|
+
type: 'Empty',
|
|
53
|
+
ecc: null,
|
|
54
|
+
clockSpeed: 0,
|
|
55
|
+
formFactor: (0, common_1.getValue)(lines, 'Form Factor:'),
|
|
56
|
+
manufacturer: '',
|
|
57
|
+
partNum: '',
|
|
58
|
+
serialNum: '',
|
|
59
|
+
voltageConfigured: null,
|
|
60
|
+
voltageMin: null,
|
|
61
|
+
voltageMax: null
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
if (!result.length) {
|
|
66
|
+
result.push({
|
|
67
|
+
size: (0, node_os_1.totalmem)(),
|
|
68
|
+
bank: '',
|
|
69
|
+
channel: null,
|
|
70
|
+
type: '',
|
|
71
|
+
ecc: null,
|
|
72
|
+
clockSpeed: 0,
|
|
73
|
+
formFactor: '',
|
|
74
|
+
manufacturer: '',
|
|
75
|
+
partNum: '',
|
|
76
|
+
serialNum: '',
|
|
77
|
+
voltageConfigured: null,
|
|
78
|
+
voltageMin: null,
|
|
79
|
+
voltageMax: null
|
|
80
|
+
});
|
|
81
|
+
({ stdout } = await (0, exec_1.exec)('cat /proc/cpuinfo 2>/dev/null', const_1.execOptsLinux));
|
|
82
|
+
let lines = stdout.split('\n');
|
|
83
|
+
const version = (0, common_1.getValue)(lines, 'revision', ':', true).toLowerCase();
|
|
84
|
+
if (await (0, raspberry_1.isRaspberry)(lines)) {
|
|
85
|
+
result[0].type = 'LPDDR2';
|
|
86
|
+
result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;
|
|
87
|
+
result[0].type = version && version[2] && version[2] === '4' ? 'LPDDR4X' : result[0].type;
|
|
88
|
+
result[0].ecc = false;
|
|
89
|
+
result[0].clockSpeed = (version && version[2] && mappings_1.raspberryClockSpeed[version[2]]) || 400;
|
|
90
|
+
result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
|
|
91
|
+
result[0].formFactor = 'SoC';
|
|
92
|
+
({ stdout } = await (0, exec_1.exec)('vcgencmd get_config sdram_freq 2>/dev/null', const_1.execOptsLinux));
|
|
93
|
+
lines = stdout.split('\n');
|
|
94
|
+
const freq = parseInt((0, common_1.getValue)(lines, 'sdram_freq', '=', true), 10) || 0;
|
|
95
|
+
if (freq) {
|
|
96
|
+
result[0].clockSpeed = freq;
|
|
97
|
+
}
|
|
98
|
+
({ stdout } = await (0, exec_1.exec)('vcgencmd measure_volts sdram_p 2>/dev/null', const_1.execOptsLinux));
|
|
99
|
+
lines = stdout.split('\n');
|
|
100
|
+
const voltage = parseFloat((0, common_1.getValue)(lines, 'volt', '=', true)) || 0;
|
|
101
|
+
if (voltage) {
|
|
102
|
+
result[0].voltageConfigured = voltage;
|
|
103
|
+
result[0].voltageMin = voltage;
|
|
104
|
+
result[0].voltageMax = voltage;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch { }
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
112
|
+
exports.memLayout = memLayout;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mem = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const defaults_1 = require("../common/defaults");
|
|
8
|
+
const mem = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initMemData);
|
|
11
|
+
try {
|
|
12
|
+
const stdout = await (0, promises_1.readFile)('/proc/meminfo');
|
|
13
|
+
const lines = stdout.toString().split('\n');
|
|
14
|
+
let total = (0, common_1.toInt)((0, common_1.getValue)(lines, 'memtotal'));
|
|
15
|
+
total = total ? total * 1024 : (0, node_os_1.totalmem)();
|
|
16
|
+
let free = (0, common_1.toInt)((0, common_1.getValue)(lines, 'memfree'));
|
|
17
|
+
free = free ? free * 1024 : (0, node_os_1.freemem)();
|
|
18
|
+
const used = total - free;
|
|
19
|
+
let buffers = (0, common_1.toInt)((0, common_1.getValue)(lines, 'buffers'));
|
|
20
|
+
buffers = buffers ? buffers * 1024 : 0;
|
|
21
|
+
let cached = (0, common_1.toInt)((0, common_1.getValue)(lines, 'cached'));
|
|
22
|
+
cached = cached ? cached * 1024 : 0;
|
|
23
|
+
let slab = (0, common_1.toInt)((0, common_1.getValue)(lines, 'slab'));
|
|
24
|
+
slab = slab ? slab * 1024 : 0;
|
|
25
|
+
const buffcache = buffers + cached + slab;
|
|
26
|
+
let available = (0, common_1.toInt)((0, common_1.getValue)(lines, 'memavailable'));
|
|
27
|
+
available = available ? available * 1024 : free + buffcache;
|
|
28
|
+
const active = total - available;
|
|
29
|
+
let swaptotal = (0, common_1.toInt)((0, common_1.getValue)(lines, 'swaptotal'));
|
|
30
|
+
swaptotal = swaptotal ? swaptotal * 1024 : 0;
|
|
31
|
+
let swapfree = (0, common_1.toInt)((0, common_1.getValue)(lines, 'swapfree'));
|
|
32
|
+
swapfree = swapfree ? swapfree * 1024 : 0;
|
|
33
|
+
const swapused = swaptotal - swapfree;
|
|
34
|
+
let writeback = (0, common_1.toInt)((0, common_1.getValue)(lines, 'writeback'));
|
|
35
|
+
writeback = writeback ? writeback * 1024 : 0;
|
|
36
|
+
let dirty = (0, common_1.toInt)((0, common_1.getValue)(lines, 'dirty'));
|
|
37
|
+
dirty = dirty ? dirty * 1024 : 0;
|
|
38
|
+
let reclaimable = (0, common_1.toInt)((0, common_1.getValue)(lines, 'sreclaimable'));
|
|
39
|
+
reclaimable = reclaimable ? reclaimable * 1024 : 0;
|
|
40
|
+
return {
|
|
41
|
+
total,
|
|
42
|
+
free,
|
|
43
|
+
used,
|
|
44
|
+
active,
|
|
45
|
+
available,
|
|
46
|
+
buffers,
|
|
47
|
+
cached,
|
|
48
|
+
slab,
|
|
49
|
+
buffcache,
|
|
50
|
+
reclaimable,
|
|
51
|
+
swaptotal,
|
|
52
|
+
swapused,
|
|
53
|
+
swapfree,
|
|
54
|
+
writeback,
|
|
55
|
+
dirty
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
return defaults;
|
|
60
|
+
};
|
|
61
|
+
exports.mem = mem;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mouse = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const parseMouse = (stdout) => {
|
|
7
|
+
const result = [];
|
|
8
|
+
const blocks = stdout.split(/\n\s*\n/);
|
|
9
|
+
blocks.forEach((block) => {
|
|
10
|
+
let bus = '';
|
|
11
|
+
let vendor = '';
|
|
12
|
+
let product = '';
|
|
13
|
+
let name = '';
|
|
14
|
+
let serial = '';
|
|
15
|
+
let handlers = '';
|
|
16
|
+
let prop = '';
|
|
17
|
+
let ev = '';
|
|
18
|
+
block.split('\n').forEach((line) => {
|
|
19
|
+
if (line.startsWith('I:')) {
|
|
20
|
+
bus = (line.match(/Bus=([0-9a-fA-F]+)/) || [])[1] || '';
|
|
21
|
+
vendor = (line.match(/Vendor=([0-9a-fA-F]+)/) || [])[1] || '';
|
|
22
|
+
product = (line.match(/Product=([0-9a-fA-F]+)/) || [])[1] || '';
|
|
23
|
+
}
|
|
24
|
+
else if (line.startsWith('N:')) {
|
|
25
|
+
name = (line.match(/Name="(.*)"/) || [])[1] || '';
|
|
26
|
+
}
|
|
27
|
+
else if (line.startsWith('U:')) {
|
|
28
|
+
serial = (line.split('=')[1] || '').trim();
|
|
29
|
+
}
|
|
30
|
+
else if (line.startsWith('H:')) {
|
|
31
|
+
handlers = line;
|
|
32
|
+
}
|
|
33
|
+
else if (line.startsWith('B: PROP=')) {
|
|
34
|
+
prop = (line.split('=')[1] || '').trim();
|
|
35
|
+
}
|
|
36
|
+
else if (line.startsWith('B: EV=')) {
|
|
37
|
+
ev = (line.split('=')[1] || '').trim();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const propMask = parseInt(prop, 16) || 0;
|
|
41
|
+
const evMask = parseInt(ev, 16) || 0;
|
|
42
|
+
const hasMouseHandler = handlers.split(/[=\s]+/).some((token) => /^mouse\d+$/.test(token));
|
|
43
|
+
const isPointer = (propMask & 0x1) !== 0;
|
|
44
|
+
if (hasMouseHandler || isPointer) {
|
|
45
|
+
const lower = name.toLowerCase();
|
|
46
|
+
const isButtonpad = (propMask & 0x4) !== 0;
|
|
47
|
+
const hasAbs = (evMask & 0x8) !== 0;
|
|
48
|
+
const hasRel = (evMask & 0x4) !== 0;
|
|
49
|
+
const isTrackpad = lower.includes('touchpad') || lower.includes('trackpad') || isButtonpad || (hasAbs && !hasRel);
|
|
50
|
+
const connection = bus === '0003' ? 'usb' : bus === '0005' ? 'bluetooth' : bus === '0011' || bus === '0018' || bus === '0019' ? 'internal' : '';
|
|
51
|
+
result.push({
|
|
52
|
+
name,
|
|
53
|
+
type: isTrackpad ? 'Trackpad' : 'Mouse',
|
|
54
|
+
vendor,
|
|
55
|
+
model: product,
|
|
56
|
+
serial,
|
|
57
|
+
connection
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
const mouse = async () => {
|
|
64
|
+
await (0, common_1.nextTick)();
|
|
65
|
+
try {
|
|
66
|
+
const stdout = (await (0, promises_1.readFile)('/proc/bus/input/devices')).toString();
|
|
67
|
+
return parseMouse(stdout);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.mouse = mouse;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkConnections = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const networkConnections = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
const result = [];
|
|
10
|
+
let stdout = '';
|
|
11
|
+
let stderr = '';
|
|
12
|
+
let cmd = 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
|
|
13
|
+
if (const_1.FREEBSD || const_1.NETBSD || const_1.OPENBSD) {
|
|
14
|
+
cmd = 'export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
|
|
15
|
+
}
|
|
16
|
+
({ stdout, stderr } = await (0, exec_1.execSave)(cmd, { maxBuffer: const_1.MAX_BUFFER_SIZE }));
|
|
17
|
+
const lines = stdout.split('\n');
|
|
18
|
+
if (!stderr && (lines.length > 1 || lines[0] !== '')) {
|
|
19
|
+
lines.forEach((line) => {
|
|
20
|
+
const lineParts = line.replace(/ +/g, ' ').split(' ');
|
|
21
|
+
if (lineParts.length >= 7) {
|
|
22
|
+
let localip = lineParts[3];
|
|
23
|
+
let localport = '';
|
|
24
|
+
const localaddress = lineParts[3].split(':');
|
|
25
|
+
if (localaddress.length > 1) {
|
|
26
|
+
localport = localaddress[localaddress.length - 1];
|
|
27
|
+
localaddress.pop();
|
|
28
|
+
localip = localaddress.join(':');
|
|
29
|
+
}
|
|
30
|
+
let peerip = lineParts[4];
|
|
31
|
+
let peerport = '';
|
|
32
|
+
const peeraddress = lineParts[4].split(':');
|
|
33
|
+
if (peeraddress.length > 1) {
|
|
34
|
+
peerport = peeraddress[peeraddress.length - 1];
|
|
35
|
+
peeraddress.pop();
|
|
36
|
+
peerip = peeraddress.join(':');
|
|
37
|
+
}
|
|
38
|
+
const connstate = lineParts[5];
|
|
39
|
+
const proc = lineParts[6].split('/');
|
|
40
|
+
if (connstate) {
|
|
41
|
+
result.push({
|
|
42
|
+
protocol: lineParts[0],
|
|
43
|
+
localAddress: localip,
|
|
44
|
+
localPort: localport,
|
|
45
|
+
peerAddress: peerip,
|
|
46
|
+
peerPort: peerport,
|
|
47
|
+
state: connstate,
|
|
48
|
+
pid: proc[0] && proc[0] !== '-' ? (0, common_1.toInt)(proc[0]) : null,
|
|
49
|
+
process: proc[1] ? proc[1].split(' ')[0].split(':')[0] : ''
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
cmd = 'ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"';
|
|
58
|
+
({ stdout, stderr } = await (0, exec_1.execSave)(cmd, { maxBuffer: const_1.MAX_BUFFER_SIZE }));
|
|
59
|
+
if (!stderr) {
|
|
60
|
+
const lines = stdout.toString().split('\n');
|
|
61
|
+
lines.forEach((line) => {
|
|
62
|
+
const lineParts = line.replace(/ +/g, ' ').split(' ');
|
|
63
|
+
if (lineParts.length >= 6) {
|
|
64
|
+
let localip = lineParts[4];
|
|
65
|
+
let localport = '';
|
|
66
|
+
const localaddress = lineParts[4].split(':');
|
|
67
|
+
if (localaddress.length > 1) {
|
|
68
|
+
localport = localaddress[localaddress.length - 1];
|
|
69
|
+
localaddress.pop();
|
|
70
|
+
localip = localaddress.join(':');
|
|
71
|
+
}
|
|
72
|
+
let peerip = lineParts[5];
|
|
73
|
+
let peerport = '';
|
|
74
|
+
const peeraddress = lineParts[5].split(':');
|
|
75
|
+
if (peeraddress.length > 1) {
|
|
76
|
+
peerport = peeraddress[peeraddress.length - 1];
|
|
77
|
+
peeraddress.pop();
|
|
78
|
+
peerip = peeraddress.join(':');
|
|
79
|
+
}
|
|
80
|
+
let connstate = lineParts[1];
|
|
81
|
+
if (connstate === 'ESTAB') {
|
|
82
|
+
connstate = 'ESTABLISHED';
|
|
83
|
+
}
|
|
84
|
+
if (connstate === 'TIME-WAIT') {
|
|
85
|
+
connstate = 'TIME_WAIT';
|
|
86
|
+
}
|
|
87
|
+
let pid = null;
|
|
88
|
+
let process = '';
|
|
89
|
+
if (lineParts.length >= 7 && lineParts[6].indexOf('users:') > -1) {
|
|
90
|
+
const proc = lineParts[6].replace('users:(("', '').replace(/"/g, '').split(',');
|
|
91
|
+
if (proc.length > 2) {
|
|
92
|
+
process = proc[0].split(' ')[0].split(':')[0];
|
|
93
|
+
pid = (0, common_1.toInt)(proc[1]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (connstate) {
|
|
97
|
+
result.push({
|
|
98
|
+
protocol: lineParts[0],
|
|
99
|
+
localAddress: localip,
|
|
100
|
+
localPort: localport,
|
|
101
|
+
peerAddress: peerip,
|
|
102
|
+
peerPort: peerport,
|
|
103
|
+
state: connstate,
|
|
104
|
+
pid,
|
|
105
|
+
process
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.networkConnections = networkConnections;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const networkGatewayDefault: () => Promise<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkGatewayDefault = void 0;
|
|
4
|
+
const exec_1 = require("../common/exec");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const networkGatewayDefault = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
let result = '';
|
|
10
|
+
const { stdout, stderr } = await (0, exec_1.execSave)('ip route get 1', { maxBuffer: const_1.MAX_BUFFER_SIZE });
|
|
11
|
+
if (!stderr) {
|
|
12
|
+
const lineParts = stdout.split('\n');
|
|
13
|
+
const line = lineParts?.length ? lineParts[0] : '';
|
|
14
|
+
let parts = line.split(' via ');
|
|
15
|
+
if (parts && parts[1]) {
|
|
16
|
+
parts = parts[1].split(' ');
|
|
17
|
+
result = parts[0];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
exports.networkGatewayDefault = networkGatewayDefault;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkInterfaceDefault = exports.getFirstExternalNetworkInterface = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const const_1 = require("../common/const");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const getFirstExternalNetworkInterface = (interfaces) => {
|
|
9
|
+
let ifacename = '';
|
|
10
|
+
let ifacenameFirst = '';
|
|
11
|
+
let scopeid = 9999;
|
|
12
|
+
for (const dev in interfaces) {
|
|
13
|
+
(interfaces[dev] || []).forEach((details) => {
|
|
14
|
+
if (details?.internal === false) {
|
|
15
|
+
ifacenameFirst = ifacenameFirst || dev;
|
|
16
|
+
if (details.scopeid && details.scopeid < scopeid) {
|
|
17
|
+
ifacename = dev;
|
|
18
|
+
scopeid = details.scopeid;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return ifacename || ifacenameFirst || '';
|
|
24
|
+
};
|
|
25
|
+
exports.getFirstExternalNetworkInterface = getFirstExternalNetworkInterface;
|
|
26
|
+
const networkInterfaceDefault = async () => {
|
|
27
|
+
await (0, common_1.nextTick)();
|
|
28
|
+
const interfaces = (0, node_os_1.networkInterfaces)();
|
|
29
|
+
let ifacename = (0, exports.getFirstExternalNetworkInterface)(interfaces);
|
|
30
|
+
try {
|
|
31
|
+
const { stdout } = await (0, exec_1.exec)('ip route 2> /dev/null | grep default', const_1.execOptsLinux);
|
|
32
|
+
const parts = stdout.split('\n')[0].split(/\s+/);
|
|
33
|
+
if (parts[0] === 'none' && parts[5]) {
|
|
34
|
+
ifacename = parts[5];
|
|
35
|
+
}
|
|
36
|
+
else if (parts[4]) {
|
|
37
|
+
ifacename = parts[4];
|
|
38
|
+
}
|
|
39
|
+
if (ifacename.indexOf(':') > -1) {
|
|
40
|
+
ifacename = ifacename.split(':')[1].trim();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch { }
|
|
44
|
+
return ifacename;
|
|
45
|
+
};
|
|
46
|
+
exports.networkInterfaceDefault = networkInterfaceDefault;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NetworkInterfacesData } from '../common/types';
|
|
2
|
+
export declare const checkLinuxDCHPInterfaces: (file: string, depth?: number) => Promise<any[]>;
|
|
3
|
+
export declare const networkInterfaces: (defaultString?: string, rescan?: boolean) => Promise<NetworkInterfacesData[]>;
|