node window manager
2.2.0
管理 Windows、macOS 和Linux (開發中)
要安裝這個包,只需運行
$ 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
目錄中。