This seems wildly overcomplicated, no?  How about just exporting a function, `isWindowInForeground(windowId)` ?  Also of course you can't do `{ foreground } = require("foreground-window");`