Control monitors.
NOTE: Monitors are supported only on
Windows, but onmacOSthere's a stub object calledEmptyMonitorfor better cross-platform compatibility without checking whether a returned monitor isundefined.
import { windowManager } from 'node-window-manager';
// Gets height of the primary window working area.
const { height } = windowManager.getPrimaryWindow().getWorkArea();idnumber - the monitor handle
idnumber
NOTE: on macOS this method returns
{x: 0, y: 0, width: 0, height: 0}for compatibility.
- Returns
Rectangle
NOTE: on macOS this method returns
{x: 0, y: 0, width: 0, height: 0}for compatibility.
Gets monitor working area bounds.
Returns Rectangle
NOTE: on macOS this method returns
falsefor compatibility.
Whether the monitor is primary.
Returns boolean
NOTE: on macOS this method returns
1for compatibility.
Gets monitor scale factor (DPI).
- Returns
number
Returns:
- On
Windows:true - On
macOS:false, since it's just anEmptyMonitorobject.