stateful-electron-window
v1.0.0
Published
Stateful Electron Window
Downloads
94
Readme
stateful-electron-window
A library to store and restore window sizes and positions for your Electron app
Installation
Install with npm:
npm install stateful-electron-window
Usage
import { StatefullBrowserWindow } from 'stateful-electron-window'
const mainWindow = new StatefullBrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
API
new StatefullBrowserWindow(options)
StatefullBrowserWindow extends BrowserWindow.
options
configFilePath
- String
The path where the state file should be written to. Defaults to
app.getPath('userData')
configFileName
- String
The name of file. Defaults to window-state.json
. This is usefull if you want to support multiple windows.
supportMaximize
- Boolean
Should we automatically maximize the window, if it was last closed
maximized. Defaults to false