This is a fork version of electron-settings with some below changes
- Use lodash to simplify the code. Make code easier to understand
- Use memory watcher instead of file watcher. Make watcher more efficient, we do not have to read file everytime we want to get a property
- Support unwatch api that allow user to unregister his watcher
Please note: because this library watches on memory instead of file. Please not that the change event is not fired when you change value directly on setting file
$ npm install --save git+https://github.com/anyTV/electron-settings.git
const { app } = require('electron');
const settings = require('electron-settings');
app.on('ready', () => {
// call method initialize() to start reading setting file and load into memory object
settings.initialize()
settings.set('name', {
first: 'Cosmo',
last: 'Kramer'
});
settings.get('name.first');
// => "Cosmo"
settings.has('name.middle');
// => false
});
ready
event, otherwise your app may encounter unexpected errors or data loss.
Having trouble? Get help on Gitter.