Preference Manager
Save your Electron app setting to a local file
Quick save and load app window settings with a single line of code. Auto-remove empty settings and many more features. Module works both in main and render processes.
Installation
npm install preference-manager
{x, y, width, height}
Quick save window params const pm = ; app;
Load and apply settings to the window
app;
Save custom settings
pm;
empty
ones
Save settings and remove pm;// => {b: 2, d: "2011-02-15T11:22:40.263Z"}
Load
pm;// => {a: 1, b: 2, c: {d: 3}}
Delete all
pm;// => {}
beautify = true
)
List all settings (with pm;/* { a: 1, b: 2, c: { d: 3 } }*/
Get settings file
pmfile;//=> C:\Users\me\AppData\Roaming\app\.settings
Changelog
2018-03-15:
- v2.0.2 Now
quickload
method will never position your app outside the screen bounds (if, for example, you disabled the second monitor, where was your app on)
2018-03-04:
- v2.0.1 Fixed bug, when app trying to save setting but app's
userData
folder does not exist yet
2018-02-13:
- v2.0.0 Rewritten from ground up. Added few more stuff to manage your settings