Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathanbuchar/electron-settings
📝 A simple persistent user settings framework for Electron.
https://github.com/nathanbuchar/electron-settings
electron javascript node
Last synced: about 10 hours ago
JSON representation
📝 A simple persistent user settings framework for Electron.
- Host: GitHub
- URL: https://github.com/nathanbuchar/electron-settings
- Owner: nathanbuchar
- License: mit
- Created: 2015-11-01T22:48:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-11T14:46:54.000Z (10 months ago)
- Last Synced: 2024-04-17T04:09:22.847Z (9 months ago)
- Topics: electron, javascript, node
- Language: TypeScript
- Homepage: https://electron-settings.js.org
- Size: 1020 KB
- Stars: 792
- Watchers: 10
- Forks: 59
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-electron - electron-settings - Reads and writes user settings to disk. ![](https://img.shields.io/github/stars/nathanbuchar/electron-settings.svg?style=social&label=Star) (Library / Persistent)
- awesome-electron-zh - electron-settings - Reads and writes user settings to disk. (Tools / For Electron)
README
# Electron Settings
A simple and robust settings management library for [Electron](https://electronjs.org).
Born from Atom's original internal configuration manager and the settings manager of choice for Electron's own [API Demos app](https://github.com/electron/electron-api-demos), Electron Settings allows you to persist user settings and other data between app loads simply and easily.
[![Npm version][badge_npm-version]][external_npm]
[![Npm downloads][badge_npm-downloads]][external_npm]
[![David][badge_david]][external_david]
[![Travis][badge_travis]][external_travis]
### Install
```
npm install electron-settings
```### Demo
```ts
import settings from 'electron-settings';await settings.set('color', {
name: 'cerulean',
code: {
rgb: [0, 179, 230],
hex: '#003BE6'
}
});await settings.get('color.name');
// => "cerulean"await settings.get('color.code.rgb[1]');
// => 179
```⚠ For Electron v10+, if you want to use electron-settings within a browser window, be sure to set the `enableRemoteModule` web preference to `true`. Otherwise you might get the error `Cannot read property 'app' of undefined`. See [#133](https://github.com/nathanbuchar/electron-settings/issues/133) for more info.
```js
new BrowserWindow({
webPreferences: {
enableRemoteModule: true // <-- Add me
}
});
```### API Docs
API docs and can be found at [electron-settings.js.org](https://electron-settings.js.org).
**Having trouble?** [Get help on Gitter][external_gitter].
[docs]: https://nathanbuchar.github.io/electron-settings/
[badge_npm-version]: https://img.shields.io/npm/v/electron-settings.svg
[badge_npm-downloads]: https://img.shields.io/npm/dm/electron-settings.svg
[badge_david]: https://img.shields.io/david/nathanbuchar/electron-settings.svg
[badge_travis]: https://img.shields.io/travis/nathanbuchar/electron-settings/master.svg[external_david]: https://david-dm.org/nathanbuchar/electron-settings
[external_electron]: https://electron.atom.io
[external_gitter]: https://gitter.im/nathanbuchar/electron-settings
[external_npm]: https://npmjs.org/package/electron-settings
[external_travis]: https://travis-ci.org/nathanbuchar/electron-settings.svg?branch=master