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.
Files changed (498) hide show
  1. package/README.md +873 -958
  2. package/dist/audio.d.ts +1 -0
  3. package/dist/audio.js +18 -0
  4. package/dist/baseboard.d.ts +1 -0
  5. package/dist/baseboard.js +17 -0
  6. package/dist/battery.d.ts +1 -0
  7. package/dist/battery.js +19 -0
  8. package/dist/bios.d.ts +1 -0
  9. package/dist/bios.js +17 -0
  10. package/dist/block-devices.d.ts +1 -0
  11. package/dist/block-devices.js +17 -0
  12. package/dist/bluetooth.d.ts +1 -0
  13. package/dist/bluetooth.js +17 -0
  14. package/dist/bsd/battery.d.ts +2 -0
  15. package/dist/bsd/battery.js +27 -0
  16. package/dist/bsd/cpu-cache.d.ts +1 -0
  17. package/dist/bsd/cpu-cache.js +37 -0
  18. package/dist/bsd/cpu-flags.d.ts +1 -0
  19. package/dist/bsd/cpu-flags.js +28 -0
  20. package/dist/bsd/cpu-temperature.d.ts +1 -0
  21. package/dist/bsd/cpu-temperature.js +29 -0
  22. package/dist/bsd/cpu.d.ts +1 -0
  23. package/dist/bsd/cpu.js +98 -0
  24. package/dist/bsd/index.d.ts +38 -0
  25. package/dist/bsd/index.js +85 -0
  26. package/dist/bsd/mem.d.ts +1 -0
  27. package/dist/bsd/mem.js +37 -0
  28. package/dist/bsd/network-stats.d.ts +2 -0
  29. package/dist/bsd/network-stats.js +92 -0
  30. package/dist/bsd/os-info.d.ts +24 -0
  31. package/dist/bsd/os-info.js +47 -0
  32. package/dist/bsd/uuid.d.ts +2 -0
  33. package/dist/bsd/uuid.js +30 -0
  34. package/dist/camera.d.ts +1 -0
  35. package/dist/camera.js +17 -0
  36. package/dist/chassis.d.ts +1 -0
  37. package/dist/chassis.js +17 -0
  38. package/dist/cli.d.ts +2 -0
  39. package/dist/cli.js +107 -0
  40. package/dist/common/acceleration.d.ts +8 -0
  41. package/dist/common/acceleration.js +86 -0
  42. package/dist/common/codepage.d.ts +1 -0
  43. package/dist/common/codepage.js +43 -0
  44. package/dist/common/const.d.ts +25 -0
  45. package/dist/common/const.js +26 -0
  46. package/dist/common/cpu.d.ts +2 -0
  47. package/dist/common/cpu.js +12 -0
  48. package/dist/common/darwin.d.ts +6 -0
  49. package/dist/common/darwin.js +266 -0
  50. package/dist/common/datetime.d.ts +9 -0
  51. package/dist/common/datetime.js +161 -0
  52. package/dist/common/defaults.d.ts +25 -0
  53. package/dist/common/defaults.js +304 -0
  54. package/dist/common/exec.d.ts +10 -0
  55. package/dist/common/exec.js +69 -0
  56. package/dist/common/files.d.ts +2 -0
  57. package/dist/common/files.js +39 -0
  58. package/dist/common/filesys.d.ts +11 -0
  59. package/dist/common/filesys.js +282 -0
  60. package/dist/common/host.d.ts +2 -0
  61. package/dist/common/host.js +67 -0
  62. package/dist/common/index.d.ts +12 -0
  63. package/dist/common/index.js +146 -0
  64. package/dist/common/internet.d.ts +6 -0
  65. package/dist/common/internet.js +92 -0
  66. package/dist/common/mappings.d.ts +55 -0
  67. package/dist/common/mappings.js +4133 -0
  68. package/dist/common/network.d.ts +8 -0
  69. package/dist/common/network.js +162 -0
  70. package/dist/common/nvidia.d.ts +22 -0
  71. package/dist/common/nvidia.js +159 -0
  72. package/dist/common/parse.d.ts +13 -0
  73. package/dist/common/parse.js +157 -0
  74. package/dist/common/raspberry.d.ts +5 -0
  75. package/dist/common/raspberry.js +277 -0
  76. package/dist/common/security.d.ts +31 -0
  77. package/dist/common/security.js +241 -0
  78. package/dist/common/types.d.ts +1024 -0
  79. package/dist/common/types.js +2 -0
  80. package/dist/common/windows.d.ts +58 -0
  81. package/dist/common/windows.js +292 -0
  82. package/dist/cpu-cache.d.ts +1 -0
  83. package/dist/cpu-cache.js +19 -0
  84. package/dist/cpu-current-load.d.ts +2 -0
  85. package/dist/cpu-current-load.js +249 -0
  86. package/dist/cpu-current-speed.d.ts +3 -0
  87. package/dist/cpu-current-speed.js +84 -0
  88. package/dist/cpu-flags.d.ts +1 -0
  89. package/dist/cpu-flags.js +19 -0
  90. package/dist/cpu-full-load.d.ts +1 -0
  91. package/dist/cpu-full-load.js +30 -0
  92. package/dist/cpu-temperature.d.ts +1 -0
  93. package/dist/cpu-temperature.js +19 -0
  94. package/dist/cpu.d.ts +1 -0
  95. package/dist/cpu.js +19 -0
  96. package/dist/darwin/audio.d.ts +2 -0
  97. package/dist/darwin/audio.js +46 -0
  98. package/dist/darwin/baseboard.d.ts +1 -0
  99. package/dist/darwin/baseboard.js +48 -0
  100. package/dist/darwin/battery.d.ts +2 -0
  101. package/dist/darwin/battery.js +65 -0
  102. package/dist/darwin/bios.d.ts +1 -0
  103. package/dist/darwin/bios.js +45 -0
  104. package/dist/darwin/block-devices.d.ts +2 -0
  105. package/dist/darwin/block-devices.js +101 -0
  106. package/dist/darwin/bluetooth.d.ts +3 -0
  107. package/dist/darwin/bluetooth.js +84 -0
  108. package/dist/darwin/camera.d.ts +2 -0
  109. package/dist/darwin/camera.js +55 -0
  110. package/dist/darwin/chassis.d.ts +2 -0
  111. package/dist/darwin/chassis.js +32 -0
  112. package/dist/darwin/cpu-cache.d.ts +2 -0
  113. package/dist/darwin/cpu-cache.js +29 -0
  114. package/dist/darwin/cpu-flags.d.ts +1 -0
  115. package/dist/darwin/cpu-flags.js +16 -0
  116. package/dist/darwin/cpu-temperature.d.ts +1 -0
  117. package/dist/darwin/cpu-temperature.js +44 -0
  118. package/dist/darwin/cpu.d.ts +1 -0
  119. package/dist/darwin/cpu.js +69 -0
  120. package/dist/darwin/disk-layout.d.ts +2 -0
  121. package/dist/darwin/disk-layout.js +231 -0
  122. package/dist/darwin/disks-io.d.ts +2 -0
  123. package/dist/darwin/disks-io.js +56 -0
  124. package/dist/darwin/displays.d.ts +2 -0
  125. package/dist/darwin/displays.js +98 -0
  126. package/dist/darwin/fs-open-files.d.ts +2 -0
  127. package/dist/darwin/fs-open-files.js +27 -0
  128. package/dist/darwin/fs-stats.d.ts +2 -0
  129. package/dist/darwin/fs-stats.js +47 -0
  130. package/dist/darwin/gpu.d.ts +2 -0
  131. package/dist/darwin/gpu.js +55 -0
  132. package/dist/darwin/index.d.ts +56 -0
  133. package/dist/darwin/index.js +122 -0
  134. package/dist/darwin/keyboard.d.ts +2 -0
  135. package/dist/darwin/keyboard.js +73 -0
  136. package/dist/darwin/mem-layout.d.ts +2 -0
  137. package/dist/darwin/mem-layout.js +60 -0
  138. package/dist/darwin/mem.d.ts +2 -0
  139. package/dist/darwin/mem.js +50 -0
  140. package/dist/darwin/mouse.d.ts +2 -0
  141. package/dist/darwin/mouse.js +78 -0
  142. package/dist/darwin/network-connections.d.ts +2 -0
  143. package/dist/darwin/network-connections.js +98 -0
  144. package/dist/darwin/network-gateway-default.d.ts +1 -0
  145. package/dist/darwin/network-gateway-default.js +26 -0
  146. package/dist/darwin/network-interface-default.d.ts +2 -0
  147. package/dist/darwin/network-interface-default.js +41 -0
  148. package/dist/darwin/network-interfaces.d.ts +2 -0
  149. package/dist/darwin/network-interfaces.js +205 -0
  150. package/dist/darwin/network-stats.d.ts +2 -0
  151. package/dist/darwin/network-stats.js +86 -0
  152. package/dist/darwin/npm.d.ts +1 -0
  153. package/dist/darwin/npm.js +5 -0
  154. package/dist/darwin/npu.d.ts +2 -0
  155. package/dist/darwin/npu.js +41 -0
  156. package/dist/darwin/os-info.d.ts +2 -0
  157. package/dist/darwin/os-info.js +140 -0
  158. package/dist/darwin/pci.d.ts +2 -0
  159. package/dist/darwin/pci.js +37 -0
  160. package/dist/darwin/printer.d.ts +2 -0
  161. package/dist/darwin/printer.js +45 -0
  162. package/dist/darwin/software.d.ts +2 -0
  163. package/dist/darwin/software.js +39 -0
  164. package/dist/darwin/system.d.ts +1 -0
  165. package/dist/darwin/system.js +29 -0
  166. package/dist/darwin/thunderbolt.d.ts +1 -0
  167. package/dist/darwin/thunderbolt.js +53 -0
  168. package/dist/darwin/usb.d.ts +3 -0
  169. package/dist/darwin/usb.js +69 -0
  170. package/dist/darwin/users.d.ts +2 -0
  171. package/dist/darwin/users.js +13 -0
  172. package/dist/darwin/uuid.d.ts +2 -0
  173. package/dist/darwin/uuid.js +39 -0
  174. package/dist/darwin/wifi-connections.d.ts +2 -0
  175. package/dist/darwin/wifi-connections.js +60 -0
  176. package/dist/darwin/wifi-interfaces.d.ts +2 -0
  177. package/dist/darwin/wifi-interfaces.js +27 -0
  178. package/dist/darwin/wifi-networks.d.ts +2 -0
  179. package/dist/darwin/wifi-networks.js +61 -0
  180. package/dist/disk-layout.d.ts +1 -0
  181. package/dist/disk-layout.js +17 -0
  182. package/dist/disks-io.d.ts +1 -0
  183. package/dist/disks-io.js +17 -0
  184. package/dist/displays.d.ts +1 -0
  185. package/dist/displays.js +17 -0
  186. package/dist/docker-socket.d.ts +11 -0
  187. package/dist/docker-socket.js +113 -0
  188. package/dist/docker.d.ts +102 -0
  189. package/dist/docker.js +532 -0
  190. package/dist/fs-open-files.d.ts +1 -0
  191. package/dist/fs-open-files.js +17 -0
  192. package/dist/fs-size.d.ts +1 -0
  193. package/dist/fs-size.js +23 -0
  194. package/dist/fs-stats.d.ts +1 -0
  195. package/dist/fs-stats.js +17 -0
  196. package/dist/get-data.d.ts +110 -0
  197. package/dist/get-data.js +151 -0
  198. package/dist/get.d.ts +5 -0
  199. package/dist/get.js +117 -0
  200. package/dist/gpu.d.ts +1 -0
  201. package/dist/gpu.js +17 -0
  202. package/dist/index.d.ts +60 -0
  203. package/dist/index.js +132 -0
  204. package/dist/inet-checksite.d.ts +1 -0
  205. package/dist/inet-checksite.js +11 -0
  206. package/dist/inet-latency.d.ts +1 -0
  207. package/dist/inet-latency.js +17 -0
  208. package/dist/inet-public-ip.d.ts +2 -0
  209. package/dist/inet-public-ip.js +10 -0
  210. package/dist/keyboard.d.ts +1 -0
  211. package/dist/keyboard.js +17 -0
  212. package/dist/linux/audio.d.ts +2 -0
  213. package/dist/linux/audio.js +67 -0
  214. package/dist/linux/baseboard.d.ts +1 -0
  215. package/dist/linux/baseboard.js +81 -0
  216. package/dist/linux/battery.d.ts +2 -0
  217. package/dist/linux/battery.js +88 -0
  218. package/dist/linux/bios.d.ts +2 -0
  219. package/dist/linux/bios.js +55 -0
  220. package/dist/linux/block-devices.d.ts +2 -0
  221. package/dist/linux/block-devices.js +30 -0
  222. package/dist/linux/bluetooth.d.ts +2 -0
  223. package/dist/linux/bluetooth.js +86 -0
  224. package/dist/linux/camera.d.ts +2 -0
  225. package/dist/linux/camera.js +63 -0
  226. package/dist/linux/chassis.d.ts +1 -0
  227. package/dist/linux/chassis.js +41 -0
  228. package/dist/linux/cpu-cache.d.ts +1 -0
  229. package/dist/linux/cpu-cache.js +35 -0
  230. package/dist/linux/cpu-flags.d.ts +1 -0
  231. package/dist/linux/cpu-flags.js +33 -0
  232. package/dist/linux/cpu-temperature.d.ts +1 -0
  233. package/dist/linux/cpu-temperature.js +179 -0
  234. package/dist/linux/cpu.d.ts +1 -0
  235. package/dist/linux/cpu.js +135 -0
  236. package/dist/linux/disk-layout.d.ts +2 -0
  237. package/dist/linux/disk-layout.js +151 -0
  238. package/dist/linux/disks-io.d.ts +2 -0
  239. package/dist/linux/disks-io.js +58 -0
  240. package/dist/linux/displays.d.ts +2 -0
  241. package/dist/linux/displays.js +193 -0
  242. package/dist/linux/fs-open-files.d.ts +2 -0
  243. package/dist/linux/fs-open-files.js +44 -0
  244. package/dist/linux/fs-size.d.ts +2 -0
  245. package/dist/linux/fs-size.js +157 -0
  246. package/dist/linux/fs-stats.d.ts +2 -0
  247. package/dist/linux/fs-stats.js +65 -0
  248. package/dist/linux/gpu.d.ts +15 -0
  249. package/dist/linux/gpu.js +383 -0
  250. package/dist/linux/index.d.ts +56 -0
  251. package/dist/linux/index.js +122 -0
  252. package/dist/linux/inet-latency.d.ts +1 -0
  253. package/dist/linux/inet-latency.js +39 -0
  254. package/dist/linux/keyboard.d.ts +2 -0
  255. package/dist/linux/keyboard.js +61 -0
  256. package/dist/linux/mem-layout.d.ts +2 -0
  257. package/dist/linux/mem-layout.js +112 -0
  258. package/dist/linux/mem.d.ts +2 -0
  259. package/dist/linux/mem.js +61 -0
  260. package/dist/linux/mouse.d.ts +2 -0
  261. package/dist/linux/mouse.js +73 -0
  262. package/dist/linux/network-connections.d.ts +2 -0
  263. package/dist/linux/network-connections.js +114 -0
  264. package/dist/linux/network-gateway-default.d.ts +1 -0
  265. package/dist/linux/network-gateway-default.js +22 -0
  266. package/dist/linux/network-interface-default.d.ts +2 -0
  267. package/dist/linux/network-interface-default.js +46 -0
  268. package/dist/linux/network-interfaces.d.ts +3 -0
  269. package/dist/linux/network-interfaces.js +353 -0
  270. package/dist/linux/network-stats.d.ts +2 -0
  271. package/dist/linux/network-stats.js +99 -0
  272. package/dist/linux/npm.d.ts +1 -0
  273. package/dist/linux/npm.js +5 -0
  274. package/dist/linux/npu.d.ts +2 -0
  275. package/dist/linux/npu.js +77 -0
  276. package/dist/linux/os-info.d.ts +1 -0
  277. package/dist/linux/os-info.js +114 -0
  278. package/dist/linux/pci.d.ts +2 -0
  279. package/dist/linux/pci.js +56 -0
  280. package/dist/linux/printer.d.ts +2 -0
  281. package/dist/linux/printer.js +80 -0
  282. package/dist/linux/process-load.d.ts +2 -0
  283. package/dist/linux/process-load.js +164 -0
  284. package/dist/linux/processes.d.ts +2 -0
  285. package/dist/linux/processes.js +358 -0
  286. package/dist/linux/services.d.ts +2 -0
  287. package/dist/linux/services.js +222 -0
  288. package/dist/linux/software.d.ts +2 -0
  289. package/dist/linux/software.js +110 -0
  290. package/dist/linux/system.d.ts +1 -0
  291. package/dist/linux/system.js +186 -0
  292. package/dist/linux/thunderbolt.d.ts +2 -0
  293. package/dist/linux/thunderbolt.js +51 -0
  294. package/dist/linux/time.d.ts +6 -0
  295. package/dist/linux/time.js +28 -0
  296. package/dist/linux/usb.d.ts +2 -0
  297. package/dist/linux/usb.js +62 -0
  298. package/dist/linux/users.d.ts +2 -0
  299. package/dist/linux/users.js +102 -0
  300. package/dist/linux/uuid.d.ts +2 -0
  301. package/dist/linux/uuid.js +44 -0
  302. package/dist/linux/wifi-connections.d.ts +2 -0
  303. package/dist/linux/wifi-connections.js +196 -0
  304. package/dist/linux/wifi-interfaces.d.ts +2 -0
  305. package/dist/linux/wifi-interfaces.js +96 -0
  306. package/dist/linux/wifi-networks.d.ts +2 -0
  307. package/dist/linux/wifi-networks.js +176 -0
  308. package/dist/mem-layout.d.ts +1 -0
  309. package/dist/mem-layout.js +17 -0
  310. package/dist/mem.d.ts +1 -0
  311. package/dist/mem.js +19 -0
  312. package/dist/mouse.d.ts +1 -0
  313. package/dist/mouse.js +17 -0
  314. package/dist/network-connections.d.ts +1 -0
  315. package/dist/network-connections.js +17 -0
  316. package/dist/network-gateway-default.d.ts +1 -0
  317. package/dist/network-gateway-default.js +17 -0
  318. package/dist/network-interface-default.d.ts +1 -0
  319. package/dist/network-interface-default.js +17 -0
  320. package/dist/network-interfaces.d.ts +1 -0
  321. package/dist/network-interfaces.js +18 -0
  322. package/dist/network-stats.d.ts +1 -0
  323. package/dist/network-stats.js +19 -0
  324. package/dist/npm.d.ts +2 -0
  325. package/dist/npm.js +22 -0
  326. package/dist/npu.d.ts +1 -0
  327. package/dist/npu.js +17 -0
  328. package/dist/observe.d.ts +5 -0
  329. package/dist/observe.js +16 -0
  330. package/dist/os-info.d.ts +1 -0
  331. package/dist/os-info.js +21 -0
  332. package/dist/pci.d.ts +1 -0
  333. package/dist/pci.js +17 -0
  334. package/dist/printer.d.ts +1 -0
  335. package/dist/printer.js +17 -0
  336. package/dist/process-load.d.ts +1 -0
  337. package/dist/process-load.js +15 -0
  338. package/dist/processes.d.ts +1 -0
  339. package/dist/processes.js +15 -0
  340. package/dist/services.d.ts +1 -0
  341. package/dist/services.js +15 -0
  342. package/dist/shell.d.ts +1 -0
  343. package/dist/shell.js +16 -0
  344. package/dist/software.d.ts +1 -0
  345. package/dist/software.js +17 -0
  346. package/dist/sun/index.d.ts +17 -0
  347. package/dist/sun/index.js +43 -0
  348. package/dist/sun/inet-latency.d.ts +1 -0
  349. package/dist/sun/inet-latency.js +30 -0
  350. package/dist/sun/os-info.d.ts +1 -0
  351. package/dist/sun/os-info.js +26 -0
  352. package/dist/sun/users.d.ts +2 -0
  353. package/dist/sun/users.js +13 -0
  354. package/dist/system.d.ts +1 -0
  355. package/dist/system.js +17 -0
  356. package/dist/thunderbolt.d.ts +1 -0
  357. package/dist/thunderbolt.js +17 -0
  358. package/dist/time.d.ts +6 -0
  359. package/dist/time.js +28 -0
  360. package/dist/usb.d.ts +1 -0
  361. package/dist/usb.js +17 -0
  362. package/dist/users.d.ts +1 -0
  363. package/dist/users.js +21 -0
  364. package/dist/uuid.d.ts +1 -0
  365. package/dist/uuid.js +19 -0
  366. package/dist/version.d.ts +1 -0
  367. package/dist/version.js +16 -0
  368. package/dist/versions.d.ts +2 -0
  369. package/dist/versions.js +1150 -0
  370. package/dist/virtualbox.d.ts +2 -0
  371. package/dist/virtualbox.js +89 -0
  372. package/dist/wifi-connections.d.ts +1 -0
  373. package/dist/wifi-connections.js +17 -0
  374. package/dist/wifi-interfaces.d.ts +1 -0
  375. package/dist/wifi-interfaces.js +17 -0
  376. package/dist/wifi-networks.d.ts +1 -0
  377. package/dist/wifi-networks.js +17 -0
  378. package/dist/windows/audio.d.ts +2 -0
  379. package/dist/windows/audio.js +23 -0
  380. package/dist/windows/baseboard.d.ts +1 -0
  381. package/dist/windows/baseboard.js +35 -0
  382. package/dist/windows/battery.d.ts +1 -0
  383. package/dist/windows/battery.js +81 -0
  384. package/dist/windows/bios.d.ts +1 -0
  385. package/dist/windows/bios.js +37 -0
  386. package/dist/windows/block-devices.d.ts +3 -0
  387. package/dist/windows/block-devices.js +58 -0
  388. package/dist/windows/bluetooth.d.ts +2 -0
  389. package/dist/windows/bluetooth.js +31 -0
  390. package/dist/windows/camera.d.ts +2 -0
  391. package/dist/windows/camera.js +47 -0
  392. package/dist/windows/chassis.d.ts +1 -0
  393. package/dist/windows/chassis.js +29 -0
  394. package/dist/windows/cpu-cache.d.ts +2 -0
  395. package/dist/windows/cpu-cache.js +59 -0
  396. package/dist/windows/cpu-flags.d.ts +1 -0
  397. package/dist/windows/cpu-flags.js +61 -0
  398. package/dist/windows/cpu-temperature.d.ts +1 -0
  399. package/dist/windows/cpu-temperature.js +32 -0
  400. package/dist/windows/cpu.d.ts +1 -0
  401. package/dist/windows/cpu.js +96 -0
  402. package/dist/windows/disk-layout.d.ts +2 -0
  403. package/dist/windows/disk-layout.js +129 -0
  404. package/dist/windows/disks-io.d.ts +2 -0
  405. package/dist/windows/disks-io.js +46 -0
  406. package/dist/windows/displays.d.ts +2 -0
  407. package/dist/windows/displays.js +213 -0
  408. package/dist/windows/fs-open-files.d.ts +2 -0
  409. package/dist/windows/fs-open-files.js +22 -0
  410. package/dist/windows/fs-size.d.ts +2 -0
  411. package/dist/windows/fs-size.js +47 -0
  412. package/dist/windows/fs-stats.d.ts +2 -0
  413. package/dist/windows/fs-stats.js +37 -0
  414. package/dist/windows/gpu.d.ts +2 -0
  415. package/dist/windows/gpu.js +128 -0
  416. package/dist/windows/index.d.ts +56 -0
  417. package/dist/windows/index.js +122 -0
  418. package/dist/windows/inet-latency.d.ts +1 -0
  419. package/dist/windows/inet-latency.js +34 -0
  420. package/dist/windows/keyboard.d.ts +2 -0
  421. package/dist/windows/keyboard.js +47 -0
  422. package/dist/windows/mem-layout.d.ts +2 -0
  423. package/dist/windows/mem-layout.js +39 -0
  424. package/dist/windows/mem.d.ts +2 -0
  425. package/dist/windows/mem.js +33 -0
  426. package/dist/windows/mouse.d.ts +2 -0
  427. package/dist/windows/mouse.js +64 -0
  428. package/dist/windows/network-connections.d.ts +2 -0
  429. package/dist/windows/network-connections.js +93 -0
  430. package/dist/windows/network-gateway-default.d.ts +1 -0
  431. package/dist/windows/network-gateway-default.js +36 -0
  432. package/dist/windows/network-interface-default.d.ts +2 -0
  433. package/dist/windows/network-interface-default.js +56 -0
  434. package/dist/windows/network-interfaces.d.ts +2 -0
  435. package/dist/windows/network-interfaces.js +346 -0
  436. package/dist/windows/network-stats.d.ts +2 -0
  437. package/dist/windows/network-stats.js +135 -0
  438. package/dist/windows/npm.d.ts +1 -0
  439. package/dist/windows/npm.js +5 -0
  440. package/dist/windows/npu.d.ts +2 -0
  441. package/dist/windows/npu.js +29 -0
  442. package/dist/windows/os-info.d.ts +1 -0
  443. package/dist/windows/os-info.js +70 -0
  444. package/dist/windows/pci.d.ts +2 -0
  445. package/dist/windows/pci.js +33 -0
  446. package/dist/windows/printer.d.ts +2 -0
  447. package/dist/windows/printer.js +36 -0
  448. package/dist/windows/process-load.d.ts +2 -0
  449. package/dist/windows/process-load.js +121 -0
  450. package/dist/windows/processes.d.ts +9 -0
  451. package/dist/windows/processes.js +139 -0
  452. package/dist/windows/services.d.ts +2 -0
  453. package/dist/windows/services.js +83 -0
  454. package/dist/windows/shell.d.ts +1 -0
  455. package/dist/windows/shell.js +19 -0
  456. package/dist/windows/software.d.ts +2 -0
  457. package/dist/windows/software.js +53 -0
  458. package/dist/windows/system.d.ts +1 -0
  459. package/dist/windows/system.js +98 -0
  460. package/dist/windows/thunderbolt.d.ts +2 -0
  461. package/dist/windows/thunderbolt.js +34 -0
  462. package/dist/windows/usb.d.ts +2 -0
  463. package/dist/windows/usb.js +37 -0
  464. package/dist/windows/users.d.ts +2 -0
  465. package/dist/windows/users.js +151 -0
  466. package/dist/windows/uuid.d.ts +2 -0
  467. package/dist/windows/uuid.js +28 -0
  468. package/dist/windows/wifi-connections.d.ts +2 -0
  469. package/dist/windows/wifi-connections.js +56 -0
  470. package/dist/windows/wifi-interfaces.d.ts +2 -0
  471. package/dist/windows/wifi-interfaces.js +45 -0
  472. package/dist/windows/wifi-networks.d.ts +2 -0
  473. package/dist/windows/wifi-networks.js +50 -0
  474. package/package.json +78 -12
  475. package/lib/audio.js +0 -277
  476. package/lib/battery.js +0 -334
  477. package/lib/bluetooth.js +0 -315
  478. package/lib/bluetoothVendors.js +0 -1138
  479. package/lib/cli.js +0 -100
  480. package/lib/cpu.js +0 -2285
  481. package/lib/docker.js +0 -791
  482. package/lib/dockerSocket.js +0 -117
  483. package/lib/filesystem.js +0 -1849
  484. package/lib/graphics.js +0 -1321
  485. package/lib/index.d.ts +0 -1051
  486. package/lib/index.js +0 -520
  487. package/lib/internet.js +0 -259
  488. package/lib/memory.js +0 -622
  489. package/lib/network.js +0 -2008
  490. package/lib/osinfo.js +0 -1322
  491. package/lib/printer.js +0 -209
  492. package/lib/processes.js +0 -1459
  493. package/lib/system.js +0 -855
  494. package/lib/usb.js +0 -309
  495. package/lib/users.js +0 -412
  496. package/lib/util.js +0 -2833
  497. package/lib/virtualbox.js +0 -116
  498. package/lib/wifi.js +0 -839
@@ -0,0 +1,353 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkInterfaces = exports.checkLinuxDCHPInterfaces = void 0;
4
+ const promises_1 = require("node:fs/promises");
5
+ const node_os_1 = require("node:os");
6
+ const node_path_1 = require("node:path");
7
+ const common_1 = require("../common");
8
+ const const_1 = require("../common/const");
9
+ const defaults_1 = require("../common/defaults");
10
+ const exec_1 = require("../common/exec");
11
+ const index_1 = require("../common/index");
12
+ const network_1 = require("../common/network");
13
+ const security_1 = require("../common/security");
14
+ const network_interface_default_1 = require("./network-interface-default");
15
+ let _interfaces = {};
16
+ let _networkInterfaces = [];
17
+ const splitSectionsNics = (lines) => {
18
+ const result = [];
19
+ let section = [];
20
+ lines.forEach((line) => {
21
+ if (!line.startsWith('\t') && !line.startsWith(' ')) {
22
+ if (section.length) {
23
+ result.push(section);
24
+ section = [];
25
+ }
26
+ }
27
+ section.push(line);
28
+ });
29
+ if (section.length) {
30
+ result.push(section);
31
+ }
32
+ return result;
33
+ };
34
+ const getLinuxIfaceConnectionName = async (interfaceName) => {
35
+ try {
36
+ const { stdout } = await (0, exec_1.execFile)('nmcli', ['device', 'status'], const_1.execOptsLinux);
37
+ const result = (0, common_1.grep)(stdout, interfaceName);
38
+ const resultFormat = result.replace(/\s+/g, ' ').trim();
39
+ const connectionNameLines = resultFormat.split(' ').slice(3);
40
+ const connectionName = connectionNameLines.join(' ');
41
+ return connectionName !== '--' ? connectionName : '';
42
+ }
43
+ catch {
44
+ return '';
45
+ }
46
+ };
47
+ const readInterfacesLines = async (file) => {
48
+ if (file.includes('*') || file.includes('?')) {
49
+ try {
50
+ const rx = new RegExp(`^${(0, node_path_1.basename)(file).replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/\?/g, '.')}$`);
51
+ const names = (await (0, promises_1.readdir)((0, node_path_1.dirname)(file))).filter((n) => rx.test(n)).sort();
52
+ const out = [];
53
+ for (const n of names) {
54
+ out.push(...(await readInterfacesLines((0, node_path_1.join)((0, node_path_1.dirname)(file), n))));
55
+ }
56
+ return out;
57
+ }
58
+ catch {
59
+ return [];
60
+ }
61
+ }
62
+ try {
63
+ return (await (0, promises_1.readFile)(file, 'utf8')).split('\n').filter((l) => /iface|source/i.test(l));
64
+ }
65
+ catch {
66
+ return [];
67
+ }
68
+ };
69
+ const checkLinuxDCHPInterfaces = async (file, depth = 0) => {
70
+ let result = [];
71
+ if (depth > 10) {
72
+ return result;
73
+ }
74
+ const lines = await readInterfacesLines(file);
75
+ for (const line of lines) {
76
+ const lower = line.toLowerCase();
77
+ const parts = line.replace(/\s+/g, ' ').trim().split(' ');
78
+ if (parts.length >= 4 && lower.indexOf(' inet ') >= 0 && lower.indexOf('dhcp') >= 0) {
79
+ result.push(parts[1]);
80
+ }
81
+ if (lower.includes('source')) {
82
+ result = result.concat(await (0, exports.checkLinuxDCHPInterfaces)(line.split(' ')[1], depth + 1));
83
+ }
84
+ }
85
+ return result;
86
+ };
87
+ exports.checkLinuxDCHPInterfaces = checkLinuxDCHPInterfaces;
88
+ const getLinuxDHCPNics = async () => {
89
+ let result = [];
90
+ try {
91
+ const { stdout } = await (0, exec_1.exec)('ip a 2> /dev/null', const_1.execOptsLinux);
92
+ const lines = stdout.split('\n');
93
+ const nsections = splitSectionsNics(lines);
94
+ result = parseLinuxDHCPNics(nsections);
95
+ }
96
+ catch {
97
+ result = await (0, exports.checkLinuxDCHPInterfaces)('/etc/network/interfaces');
98
+ }
99
+ return result;
100
+ };
101
+ const parseLinuxDHCPNics = (sections) => {
102
+ const result = [];
103
+ if (sections?.length) {
104
+ sections.forEach((lines) => {
105
+ if (lines?.length) {
106
+ const parts = lines[0].split(':');
107
+ if (parts.length > 2) {
108
+ for (const line of lines) {
109
+ if (line.indexOf(' inet ') >= 0 && line.indexOf(' dynamic ') >= 0) {
110
+ const parts2 = line.split(' ');
111
+ const nic = parts2[parts2.length - 1].trim();
112
+ result.push(nic);
113
+ break;
114
+ }
115
+ }
116
+ }
117
+ }
118
+ });
119
+ }
120
+ return result;
121
+ };
122
+ const getLinuxIfaceDHCPstatus = async (iface, connectionName, DHCPNics) => {
123
+ let result = false;
124
+ if (connectionName) {
125
+ try {
126
+ const { stdout } = await (0, exec_1.execFile)('nmcli', ['connection', 'show', connectionName], const_1.execOptsLinux);
127
+ const res = (0, common_1.grep)(stdout, 'ipv4.method');
128
+ const resultFormat = res.replace(/\s+/g, ' ').trim();
129
+ const dhcStatus = resultFormat.split(' ').slice(1).toString();
130
+ switch (dhcStatus) {
131
+ case 'auto':
132
+ result = true;
133
+ break;
134
+ default:
135
+ result = false;
136
+ break;
137
+ }
138
+ return result;
139
+ }
140
+ catch {
141
+ return DHCPNics.indexOf(iface) >= 0;
142
+ }
143
+ }
144
+ else {
145
+ return DHCPNics.indexOf(iface) >= 0;
146
+ }
147
+ };
148
+ const getLinuxIfaceDNSsuffix = async (connectionName) => {
149
+ if (connectionName) {
150
+ try {
151
+ const { stdout } = await (0, exec_1.execFile)('nmcli', ['connection', 'show', connectionName], const_1.execOptsLinux);
152
+ const res = (0, common_1.grep)(stdout, 'ipv4.dns-search');
153
+ const resultFormat = res.replace(/\s+/g, ' ').trim();
154
+ const dnsSuffix = resultFormat.split(' ').slice(1).toString();
155
+ return dnsSuffix === '--' ? 'Not defined' : dnsSuffix;
156
+ }
157
+ catch {
158
+ return 'Unknown';
159
+ }
160
+ }
161
+ else {
162
+ return 'Unknown';
163
+ }
164
+ };
165
+ const getLinuxIfaceIEEE8021xAuth = async (connectionName) => {
166
+ if (connectionName) {
167
+ try {
168
+ const { stdout } = await (0, exec_1.execFile)('nmcli', ['connection', 'show', connectionName], const_1.execOptsLinux);
169
+ const res = (0, common_1.grep)(stdout, '802-1x.eap');
170
+ const resultFormat = res.replace(/\s+/g, ' ').trim();
171
+ const authenticationProtocol = resultFormat.split(' ').slice(1).toString();
172
+ return authenticationProtocol === '--' ? '' : authenticationProtocol;
173
+ }
174
+ catch {
175
+ return 'Not defined';
176
+ }
177
+ }
178
+ else {
179
+ return 'Not defined';
180
+ }
181
+ };
182
+ const getLinuxIfaceIEEE8021xState = (authenticationProtocol) => {
183
+ if (authenticationProtocol) {
184
+ if (authenticationProtocol === 'Not defined') {
185
+ return 'Disabled';
186
+ }
187
+ return 'Enabled';
188
+ }
189
+ else {
190
+ return 'Unknown';
191
+ }
192
+ };
193
+ const networkInterfaces = async (defaultString = '', rescan = true) => {
194
+ await (0, common_1.nextTick)();
195
+ const interfaces = (0, node_os_1.networkInterfaces)();
196
+ if (JSON.stringify(interfaces) === JSON.stringify(_interfaces) && !rescan) {
197
+ return _networkInterfaces;
198
+ }
199
+ _interfaces = (0, index_1.cloneObj)(interfaces);
200
+ let result = [];
201
+ try {
202
+ const _dhcpNics = await getLinuxDHCPNics();
203
+ const defaultInterface = await (0, network_interface_default_1.networkInterfaceDefault)();
204
+ for (const dev in interfaces) {
205
+ const iface = dev;
206
+ let ip4 = '';
207
+ let ip4subnet = '';
208
+ let ip6 = '';
209
+ let ip6subnet = '';
210
+ let mac = '';
211
+ let duplex = '';
212
+ let mtu = 0;
213
+ let speed = 0;
214
+ let carrierChanges = 0;
215
+ let dhcp = false;
216
+ let dnsSuffix = '';
217
+ let ieee8021xAuth = '';
218
+ let ieee8021xState = '';
219
+ let type = '';
220
+ let ip4link = '';
221
+ let ip4linksubnet = '';
222
+ let ip6link = '';
223
+ let ip6linksubnet = '';
224
+ const ifaceName = dev;
225
+ for (const details of interfaces[dev] || []) {
226
+ if (details.family === 'IPv4' || details.family === 4) {
227
+ if (!ip4 && !ip4.match(/^169.254/i)) {
228
+ ip4 = details.address;
229
+ ip4subnet = details.netmask;
230
+ }
231
+ if (ip4.match(/^169.254/i)) {
232
+ ip4link = details.address;
233
+ ip4linksubnet = details.netmask;
234
+ }
235
+ }
236
+ if (details.family === 'IPv6' || details.family === 6) {
237
+ if (!ip6 && !ip6.match(/^fe80::/i)) {
238
+ ip6 = details.address;
239
+ ip6subnet = details.netmask;
240
+ }
241
+ if (ip6.match(/^fe80::/i)) {
242
+ ip6link = details.address;
243
+ ip6linksubnet = details.netmask;
244
+ }
245
+ }
246
+ mac = details.mac;
247
+ }
248
+ if (!ip4 && ip4link) {
249
+ ip4 = ip4link;
250
+ ip4subnet = ip4linksubnet;
251
+ }
252
+ if (!ip6 && ip6link) {
253
+ ip6 = ip6link;
254
+ ip6subnet = ip6linksubnet;
255
+ }
256
+ const ifaceDevName = dev.split(':')[0].trim();
257
+ const ifaceSanitized = (0, security_1.sanitizeString)(ifaceDevName);
258
+ const cmd = `echo -n "addr_assign_type: "; cat /sys/class/net/${ifaceSanitized}/addr_assign_type 2>/dev/null; echo;
259
+ echo -n "address: "; cat /sys/class/net/${ifaceSanitized}/address 2>/dev/null; echo;
260
+ echo -n "addr_len: "; cat /sys/class/net/${ifaceSanitized}/addr_len 2>/dev/null; echo;
261
+ echo -n "broadcast: "; cat /sys/class/net/${ifaceSanitized}/broadcast 2>/dev/null; echo;
262
+ echo -n "carrier: "; cat /sys/class/net/${ifaceSanitized}/carrier 2>/dev/null; echo;
263
+ echo -n "carrier_changes: "; cat /sys/class/net/${ifaceSanitized}/carrier_changes 2>/dev/null; echo;
264
+ echo -n "dev_id: "; cat /sys/class/net/${ifaceSanitized}/dev_id 2>/dev/null; echo;
265
+ echo -n "dev_port: "; cat /sys/class/net/${ifaceSanitized}/dev_port 2>/dev/null; echo;
266
+ echo -n "dormant: "; cat /sys/class/net/${ifaceSanitized}/dormant 2>/dev/null; echo;
267
+ echo -n "duplex: "; cat /sys/class/net/${ifaceSanitized}/duplex 2>/dev/null; echo;
268
+ echo -n "flags: "; cat /sys/class/net/${ifaceSanitized}/flags 2>/dev/null; echo;
269
+ echo -n "gro_flush_timeout: "; cat /sys/class/net/${ifaceSanitized}/gro_flush_timeout 2>/dev/null; echo;
270
+ echo -n "ifalias: "; cat /sys/class/net/${ifaceSanitized}/ifalias 2>/dev/null; echo;
271
+ echo -n "ifindex: "; cat /sys/class/net/${ifaceSanitized}/ifindex 2>/dev/null; echo;
272
+ echo -n "iflink: "; cat /sys/class/net/${ifaceSanitized}/iflink 2>/dev/null; echo;
273
+ echo -n "link_mode: "; cat /sys/class/net/${ifaceSanitized}/link_mode 2>/dev/null; echo;
274
+ echo -n "mtu: "; cat /sys/class/net/${ifaceSanitized}/mtu 2>/dev/null; echo;
275
+ echo -n "netdev_group: "; cat /sys/class/net/${ifaceSanitized}/netdev_group 2>/dev/null; echo;
276
+ echo -n "operstate: "; cat /sys/class/net/${ifaceSanitized}/operstate 2>/dev/null; echo;
277
+ echo -n "proto_down: "; cat /sys/class/net/${ifaceSanitized}/proto_down 2>/dev/null; echo;
278
+ echo -n "speed: "; cat /sys/class/net/${ifaceSanitized}/speed 2>/dev/null; echo;
279
+ echo -n "tx_queue_len: "; cat /sys/class/net/${ifaceSanitized}/tx_queue_len 2>/dev/null; echo;
280
+ echo -n "type: "; cat /sys/class/net/${ifaceSanitized}/type 2>/dev/null; echo;
281
+ echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${ifaceSanitized}; echo;
282
+ echo -n "wirelessspeed: "; iw dev ${ifaceSanitized} link 2>&1 | grep bitrate; echo;`;
283
+ let lines = [];
284
+ try {
285
+ const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
286
+ lines = stdout.split('\n');
287
+ const connectionName = await getLinuxIfaceConnectionName(ifaceSanitized);
288
+ dhcp = await getLinuxIfaceDHCPstatus(ifaceSanitized, connectionName, _dhcpNics);
289
+ dnsSuffix = await getLinuxIfaceDNSsuffix(connectionName);
290
+ ieee8021xAuth = await getLinuxIfaceIEEE8021xAuth(connectionName);
291
+ ieee8021xState = getLinuxIfaceIEEE8021xState(ieee8021xAuth);
292
+ }
293
+ catch { }
294
+ duplex = (0, common_1.getValue)(lines, 'duplex');
295
+ duplex = duplex.startsWith('cat') ? '' : duplex;
296
+ mtu = (0, common_1.toInt)((0, common_1.getValue)(lines, 'mtu'));
297
+ let myspeed = (0, common_1.toInt)((0, common_1.getValue)(lines, 'speed'));
298
+ speed = Number.isNaN(myspeed) ? null : myspeed;
299
+ const wirelessspeed = (0, common_1.getValue)(lines, 'tx bitrate');
300
+ if (speed === null && wirelessspeed) {
301
+ myspeed = Number.parseFloat(wirelessspeed);
302
+ speed = Number.isNaN(myspeed) ? null : myspeed;
303
+ }
304
+ carrierChanges = (0, common_1.toInt)((0, common_1.getValue)(lines, 'carrier_changes'));
305
+ const operstate = (0, common_1.getValue)(lines, 'operstate');
306
+ type = operstate === 'up' ? ((0, common_1.getValue)(lines, 'wireless').trim() ? 'wireless' : 'wired') : 'unknown';
307
+ if (ifaceSanitized === 'lo' || ifaceSanitized.startsWith('bond')) {
308
+ type = 'virtual';
309
+ }
310
+ let internal = interfaces[dev] && (interfaces[dev] || [])[0] ? (interfaces[dev] || [])[0].internal : false;
311
+ if (dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1) {
312
+ internal = true;
313
+ }
314
+ const virtual = internal ? false : (0, network_1.testVirtualNic)(dev, ifaceName, mac);
315
+ result.push({
316
+ ...defaults_1.initNetworkInterface,
317
+ iface: ifaceSanitized,
318
+ ifaceName,
319
+ default: iface === defaultInterface,
320
+ ip4,
321
+ ip4subnet,
322
+ ip6,
323
+ ip6subnet,
324
+ mac,
325
+ internal,
326
+ virtual,
327
+ operstate,
328
+ type,
329
+ duplex,
330
+ mtu,
331
+ speed,
332
+ dhcp,
333
+ dnsSuffix,
334
+ ieee8021xAuth,
335
+ ieee8021xState,
336
+ carrierChanges
337
+ });
338
+ }
339
+ }
340
+ catch { }
341
+ _networkInterfaces = result;
342
+ if (defaultString.toLowerCase().indexOf('default') >= 0) {
343
+ result = result.filter((item) => item.default);
344
+ if (result.length > 0) {
345
+ return [result[0]];
346
+ }
347
+ else {
348
+ result = [];
349
+ }
350
+ }
351
+ return result;
352
+ };
353
+ exports.networkInterfaces = networkInterfaces;
@@ -0,0 +1,2 @@
1
+ import { NetworkStatsData } from '../common/types';
2
+ export declare const networkStats: (interfaces?: string) => Promise<NetworkStatsData[]>;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkStats = void 0;
4
+ const files_1 = require("../common/files");
5
+ const exec_1 = require("../common/exec");
6
+ const common_1 = require("../common");
7
+ const security_1 = require("../common/security");
8
+ const defaults_1 = require("../common/defaults");
9
+ const index_1 = require("./index");
10
+ const network_1 = require("../common/network");
11
+ const _network = {};
12
+ const networkStatsSingle = async (iface) => {
13
+ await (0, common_1.nextTick)();
14
+ const defaults = defaults_1.initNetworkSpeed;
15
+ if (!_network[iface] || (_network[iface] && !_network[iface].ms) || (_network[iface] && _network[iface].ms && Date.now() - _network[iface].ms >= 500)) {
16
+ if (await (0, files_1.fileExists)('/sys/class/net/' + iface)) {
17
+ const cmd = 'cat /sys/class/net/' +
18
+ iface +
19
+ '/operstate; ' +
20
+ 'cat /sys/class/net/' +
21
+ iface +
22
+ '/statistics/rx_bytes; ' +
23
+ 'cat /sys/class/net/' +
24
+ iface +
25
+ '/statistics/tx_bytes; ' +
26
+ 'cat /sys/class/net/' +
27
+ iface +
28
+ '/statistics/rx_dropped; ' +
29
+ 'cat /sys/class/net/' +
30
+ iface +
31
+ '/statistics/rx_errors; ' +
32
+ 'cat /sys/class/net/' +
33
+ iface +
34
+ '/statistics/tx_dropped; ' +
35
+ 'cat /sys/class/net/' +
36
+ iface +
37
+ '/statistics/tx_errors; ';
38
+ const { stdout } = await (0, exec_1.execSave)(cmd);
39
+ if (stdout) {
40
+ const lines = stdout.split('\n');
41
+ const operstate = lines[0].trim();
42
+ const rx_bytes = (0, common_1.toInt)(lines[1]);
43
+ const tx_bytes = (0, common_1.toInt)(lines[2]);
44
+ const rx_dropped = (0, common_1.toInt)(lines[3]);
45
+ const rx_errors = (0, common_1.toInt)(lines[4]);
46
+ const tx_dropped = (0, common_1.toInt)(lines[5]);
47
+ const tx_errors = (0, common_1.toInt)(lines[6]);
48
+ return (0, network_1.calcNetworkSpeed)(iface, rx_bytes, tx_bytes, rx_dropped, rx_errors, tx_dropped, tx_errors, operstate, _network);
49
+ }
50
+ }
51
+ return defaults;
52
+ }
53
+ else {
54
+ return {
55
+ ...defaults,
56
+ rx_bytes: _network[iface].rx_bytes,
57
+ tx_bytes: _network[iface].tx_bytes,
58
+ rx_sec: _network[iface].rx_sec,
59
+ tx_sec: _network[iface].tx_sec,
60
+ rx_dropped: _network[iface].rx_dropped,
61
+ tx_dropped: _network[iface].tx_dropped,
62
+ rx_errors: _network[iface].rx_errors,
63
+ tx_errors: _network[iface].tx_errors,
64
+ ms: _network[iface].last_ms,
65
+ operstate: _network[iface].operstate
66
+ };
67
+ }
68
+ };
69
+ const networkStats = async (interfaces = '') => {
70
+ const result = [];
71
+ let interfacesArray = [];
72
+ const interfacesSanitized = (0, security_1.sanitizeInterfacesString)(interfaces);
73
+ if (interfaces === '') {
74
+ interfacesArray = [await (0, index_1.networkInterfaceDefault)()];
75
+ }
76
+ else if (interfacesSanitized === '-') {
77
+ return result;
78
+ }
79
+ else if (interfacesSanitized === '*') {
80
+ const allIFaces = await (0, index_1.networkInterfaces)('', false);
81
+ for (const iface of allIFaces || []) {
82
+ interfacesArray.push(iface.iface);
83
+ }
84
+ }
85
+ else {
86
+ interfacesArray = interfacesSanitized.split('|');
87
+ }
88
+ const workload = [];
89
+ for (const iface of interfacesArray) {
90
+ workload.push(networkStatsSingle(iface.trim()));
91
+ }
92
+ if (workload.length) {
93
+ return await Promise.all(workload);
94
+ }
95
+ else {
96
+ return result;
97
+ }
98
+ };
99
+ exports.networkStats = networkStats;
@@ -0,0 +1 @@
1
+ export { npm } from '../npm';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.npm = void 0;
4
+ var npm_1 = require("../npm");
5
+ Object.defineProperty(exports, "npm", { enumerable: true, get: function () { return npm_1.npm; } });
@@ -0,0 +1,2 @@
1
+ import { NpuData } from '../common/types';
2
+ export declare const npu: () => Promise<NpuData[]>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.npu = void 0;
4
+ const promises_1 = require("node:fs/promises");
5
+ const common_1 = require("../common");
6
+ const defaults_1 = require("../common/defaults");
7
+ const ACCEL_PATH = '/sys/class/accel';
8
+ const readAttr = async (path) => {
9
+ try {
10
+ return (await (0, promises_1.readFile)(path)).toString().trim();
11
+ }
12
+ catch {
13
+ return '';
14
+ }
15
+ };
16
+ const vendorName = (vendorId) => {
17
+ switch (vendorId) {
18
+ case '8086':
19
+ return 'Intel';
20
+ case '1022':
21
+ case '1002':
22
+ return 'AMD';
23
+ case '10de':
24
+ return 'NVIDIA';
25
+ default:
26
+ return '';
27
+ }
28
+ };
29
+ const driverLabel = (driver) => {
30
+ switch (driver) {
31
+ case 'ivpu':
32
+ return 'Intel AI Boost NPU';
33
+ case 'amdxdna':
34
+ return 'AMD XDNA NPU';
35
+ default:
36
+ return 'NPU';
37
+ }
38
+ };
39
+ const npu = async () => {
40
+ await (0, common_1.nextTick)();
41
+ const result = [];
42
+ const seen = new Set();
43
+ try {
44
+ const nodes = (await (0, promises_1.readdir)(ACCEL_PATH)).filter((node) => node.startsWith('accel')).sort();
45
+ for (const node of nodes) {
46
+ let dev;
47
+ try {
48
+ dev = await (0, promises_1.realpath)(`${ACCEL_PATH}/${node}/device`);
49
+ }
50
+ catch {
51
+ continue;
52
+ }
53
+ if (seen.has(dev)) {
54
+ continue;
55
+ }
56
+ seen.add(dev);
57
+ const vendorId = (await readAttr(`${dev}/vendor`)).replace(/^0x/i, '').toLowerCase();
58
+ const deviceId = (await readAttr(`${dev}/device`)).replace(/^0x/i, '').toLowerCase();
59
+ let driver = '';
60
+ try {
61
+ driver = (await (0, promises_1.readlink)(`${dev}/driver`)).split('/').pop() || '';
62
+ }
63
+ catch { }
64
+ result.push({
65
+ ...(0, common_1.cloneObj)(defaults_1.initNpuData),
66
+ vendor: vendorName(vendorId),
67
+ name: driverLabel(driver),
68
+ vendorId,
69
+ deviceId,
70
+ driver
71
+ });
72
+ }
73
+ }
74
+ catch { }
75
+ return result;
76
+ };
77
+ exports.npu = npu;
@@ -0,0 +1 @@
1
+ export declare const osInfo: () => Promise<any>;
@@ -0,0 +1,114 @@
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 const_1 = require("../common/const");
7
+ const defaults_1 = require("../common/defaults");
8
+ const exec_1 = require("../common/exec");
9
+ const files_1 = require("../common/files");
10
+ const mappings_1 = require("../common/mappings");
11
+ const uuid_1 = require("./uuid");
12
+ const getInstallDate = async () => {
13
+ try {
14
+ const { stdout } = await (0, exec_1.exec)('stat -c %W / 2>/dev/null', const_1.execOptsLinux);
15
+ const sec = parseInt(stdout.toString().trim(), 10);
16
+ if (sec > 0) {
17
+ return new Date(sec * 1000);
18
+ }
19
+ }
20
+ catch { }
21
+ try {
22
+ const { stdout: dfOut } = await (0, exec_1.exec)('df -P / 2>/dev/null', const_1.execOptsLinux);
23
+ const dev = (dfOut.toString().split('\n')[1] || '').split(/\s+/)[0] || '';
24
+ if (/^\/dev\/[\w./-]+$/.test(dev)) {
25
+ const { stdout } = await (0, exec_1.exec)(`tune2fs -l ${dev} 2>/dev/null`, const_1.execOptsLinux);
26
+ const line = stdout
27
+ .toString()
28
+ .split('\n')
29
+ .find((l) => l.toLowerCase().includes('filesystem created'));
30
+ if (line) {
31
+ const date = new Date(line.split(':').slice(1).join(':').trim());
32
+ if (!Number.isNaN(date.getTime())) {
33
+ return date;
34
+ }
35
+ }
36
+ }
37
+ }
38
+ catch { }
39
+ return null;
40
+ };
41
+ const getLastUpdate = async () => {
42
+ const paths = '/var/log/apt/history.log /var/log/dpkg.log /var/lib/rpm/rpmdb.sqlite /var/lib/rpm/Packages /var/log/dnf.rpm.log /var/log/yum.log /var/log/zypp/history /var/log/pacman.log /lib/apk/db/installed /var/db/pkg';
43
+ const { stdout } = await (0, exec_1.execSave)(`stat -c %Y ${paths} 2>/dev/null`, const_1.execOptsLinux);
44
+ const times = (stdout || '')
45
+ .split('\n')
46
+ .map((line) => parseInt(line.trim(), 10))
47
+ .filter((sec) => sec > 0);
48
+ return times.length ? new Date(Math.max(...times) * 1000) : null;
49
+ };
50
+ const getDisplayServer = async () => {
51
+ if (const_1.ANDROID) {
52
+ const { stdout } = await (0, exec_1.execSave)('pgrep -f surfaceflinger 2>/dev/null || ps -A 2>/dev/null | grep surfaceflinger', const_1.execOptsLinux);
53
+ return (stdout || '').trim() ? 'surfaceflinger' : '';
54
+ }
55
+ const sessionType = (process.env.XDG_SESSION_TYPE || '').toLowerCase();
56
+ if (sessionType) {
57
+ return sessionType;
58
+ }
59
+ return process.env.WAYLAND_DISPLAY ? 'wayland' : process.env.DISPLAY ? 'x11' : '';
60
+ };
61
+ const linuxIsUefi = async () => {
62
+ if (await (0, files_1.fileExists)('/sys/firmware/efi')) {
63
+ return true;
64
+ }
65
+ else {
66
+ const { stdout } = await (0, exec_1.execSave)('dmesg | grep -E "EFI v"', const_1.execOptsLinux);
67
+ return stdout.split('\n').length > 0 && stdout.indexOf('EFI') >= 0;
68
+ }
69
+ };
70
+ const parseOsInfo = async (stdout, defaults) => {
71
+ const release = {};
72
+ const lines = stdout.toString().split('\n');
73
+ lines.forEach((line) => {
74
+ if (line.indexOf('=') !== -1) {
75
+ release[line.split('=')[0].trim().toUpperCase()] = line.split('=')[1].trim();
76
+ }
77
+ });
78
+ const distro = (release.DISTRIB_ID || release.NAME || 'unknown').replace(/"/g, '');
79
+ let releaseVersion = (release.VERSION || '').replace(/"/g, '');
80
+ let codename = (release.DISTRIB_CODENAME || release.VERSION_CODENAME || '').replace(/"/g, '');
81
+ const prettyName = (release.PRETTY_NAME || '').replace(/"/g, '');
82
+ if (prettyName.indexOf(distro + ' ') === 0) {
83
+ releaseVersion = prettyName.replace(distro + ' ', '').trim();
84
+ }
85
+ if (releaseVersion.indexOf('(') >= 0) {
86
+ codename = releaseVersion.split('(')[1].replace(/[()]/g, '').trim();
87
+ releaseVersion = releaseVersion.split('(')[0].trim();
88
+ }
89
+ return {
90
+ ...defaults,
91
+ distro: (release.DISTRIB_ID || release.NAME || 'unknown').replace(/"/g, ''),
92
+ logofile: (0, mappings_1.getLogoFile)(distro),
93
+ release: (releaseVersion || release.DISTRIB_RELEASE || release.VERSION_ID || 'unknown').replace(/"/g, ''),
94
+ codename: codename,
95
+ codepage: (0, codepage_1.getCodepage)(),
96
+ build: (release.BUILD_ID || '').replace(/"/g, '').trim(),
97
+ uefi: await linuxIsUefi(),
98
+ serial: (await (0, uuid_1.uuid)()).os,
99
+ installDate: await getInstallDate(),
100
+ lastUpdate: await getLastUpdate(),
101
+ displayServer: await getDisplayServer()
102
+ };
103
+ };
104
+ const osInfo = async () => {
105
+ await (0, common_1.nextTick)();
106
+ const defaults = (0, common_1.cloneObj)(await (0, defaults_1.initOsInfo)());
107
+ try {
108
+ const { stdout } = await (0, exec_1.execSave)('cat /etc/*-release 2>/dev/null; cat /usr/lib/os-release 2>/dev/null; cat /etc/openwrt_release 2>/dev/null');
109
+ return await parseOsInfo(stdout, defaults);
110
+ }
111
+ catch { }
112
+ return defaults;
113
+ };
114
+ exports.osInfo = osInfo;
@@ -0,0 +1,2 @@
1
+ import { PciData } from '../common/types';
2
+ export declare const pci: () => Promise<PciData[]>;