Small Module that returns an array with all the monitors connected to the pc with their resolution and position.
The standard API of electron already do this, but under Windows the screen api suffers lot of issues.
Works only under Windows OS!
If you want to manage screens with other OS have a look here.
Download and install
electron-screen through npm, then require it:
const screen =console
electron-screen returns the following array of objects, where every object is a different screen :
bounds:x: Numbery: Numberwidth: Numberheight: Number
- For testing:
$ npm build .
- For use the module inside Electron:
Follow this instructions.
- Wrap Electron's native screen API and use electron-screen only under Windows.
- Add testing
If you feel you can help in any way, be it with examples, extra testing, or new features please open a pull request or open an issue.
I would make a special thanks to @Corralx for helping me to improving the code.
The code is released under the MIT license.
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.