'Node.js Windows 10/11: How to set the position of a window?

Is it possible to set/get the position of other windows in node.js in Windows 10/11?

One of my windows keeps moving to my first monitor when Windows goes to sleep / the monitors turn off and it's extremely annoying.

Just want to make a quick script that can get/set a window's position by name.

Example: Say I want to move the window "Discord" to x: 60, y: 55, how would I accomplish this in node.js?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source