node-mac-virtual-display
node-mac-virtual-display copied to clipboard
A Node native module to create virutal display of macOS
node-mac-virtual-display: Native Library for Virtual Display on macOS
A native library for macOS to create virtual displays for your applications using Node.js. This library uses CoreGraphics and CoreDisplay APIs to provide an interface for creating and managing virtual displays on macOS.
Features
- [x] Create and Destroy single virtual displays on macOS.
- [x] Configurable display resolution and refresh rate.
- [x] Create a virtual display by cloning the main display.
- [ ] Support for multiple virtual displays.
Requirements
- macOS 10.14 or later
- Node.js 12 or later
Installation
Use npm to install the library:
yarn add node-mac-virtual-display
Usage
To create/destroy a virtual display:
const VirtualDisplay = require('node-mac-virtual-display')
const vdisplay = new VirtualDisplay()
// Clone primary display
vdisplay.cloneVirtualDisplay()
// OR
// To create a virtual display:
vdisplay.createVirtualDisplay({
width: 1920,
height: 1080,
frameRate: 60,
hiDPI: true,
displayName: "Virtual Display"
})
//To destroy a virtual display:
vdisplay.destroyVirtualDisplay()
Contribute
Coffee fuels coding ☕️