@miniben90/x-win
This package allows you to retrieve precise information about active and open windows on Windows, MacOS, and Linux. You can obtain the position, size, title, and other memory of windows.
active-windows
Get information about active windows and idle time on Windows, Linux and MacOS