node window manager
2.2.0
จัดการหน้าต่างใน Windows, macOS และ ลินุกซ์ (งานระหว่างดำเนินการ)
หากต้องการติดตั้งแพ็คเกจนี้เพียงแค่เรียกใช้
$ npm install node-window-manager
ตัวอย่างต่อไปนี้แสดงวิธีรับชื่อหน้าต่างที่โฟกัสอยู่ในปัจจุบันและซ่อนไว้
const { windowManager } = require ( "node-window-manager" ) ;
const window = windowManager . getActiveWindow ( ) ;
// Prints the currently focused window bounds.
console . log ( window . getBounds ( ) ) ;
// This method has to be called on macOS before changing the window's bounds, otherwise it will throw an error.
// It will prompt an accessibility permission request dialog, if needed.
windowManager . requestAccessibility ( ) ;
// Sets the active window's bounds.
window . setBounds ( { x : 0 , y : 0 } ) ;
เอกสารประกอบและการอ้างอิง API อยู่ในไดเร็กทอรี docs