electron-pref

simple preference control for electron

Usage no npm install needed!

<script type="module">
  import electronPref from 'https://cdn.skypack.dev/electron-pref';
</script>

README

electron-pref

Build Status

simple preference control for electron

Automatically save your settings in a JSON file under electron.app.getPath('UserData') directory.

This module can be used in both main and renderer process. And works well with webpack.

Translations

中文

install

npm install --save electron-pref

usage

const pref = require('electron-pref');
const setting = pref.from({
    foo: 'bar'
});

console.log(setting.get('foo'));
// -> 'bar'

setting.set('foo', 'baz');
console.log(setting.get('foo'));
// -> 'baz'

license

MIT