mezon-active-windows
Version:
Get information about active windows and idle time on Windows, Linux and MacOS
19 lines (15 loc) • 415 B
JavaScript
/**
* Executes getActiveWindow every second and prints it the console
*
* Run with `node sample.js`
*/
const activeWindows = require('./index');
const interval = setInterval(() => {
let result = activeWindows.getActiveWindow();
console.log(result);
// Error returned from cpp is added to the object
if (result.error) {
console.log('error', result);
clearInterval(interval);
}
}, 1000);