# electron-settings

> A simple and robust settings management library for Electron.

Latest version **4.0.4** (published 2024-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install electron-settings
pnpm add electron-settings
yarn add electron-settings
bun add electron-settings
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.4 |
| Published | 2024-04-23 |
| First published | 2015-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 48.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 822 |
| Author | Nathan Buchar |
| Maintainers | nathanbuchar |
| Keywords | electron, app, user, data, settings, config, storage, json |

## Links

- npm: https://www.npmjs.com/package/electron-settings
- Repository: https://github.com/nathanbuchar/electron-settings
- Homepage: https://github.com/nathanbuchar/electron-settings#readme
- Issues: https://github.com/nathanbuchar/electron-settings/issues
- npm.io page: https://npm.io/package/electron-settings

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [write-file-atomic](https://npm.io/package/write-file-atomic.md) ^3.0.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 4.0.4 (latest) — 2024-04-23
- 4.0.3 — 2024-04-11
- 5.0.0 — 2023-04-20
- 4.0.2 — 2020-06-27
- 4.0.1 — 2020-06-20
- 4.0.0 — 2020-06-07
- 3.2.0 — 2018-05-17
- 3.1.4 — 2017-11-05
- 3.1.3 — 2017-10-17
- 3.1.2 — 2017-09-25
- 3.1.1 — 2017-06-04
- 3.1.0 — 2017-06-04
- 3.0.14 — 2017-04-04
- 3.0.13 — 2017-04-04
- 3.0.12 — 2017-04-04
- … 32 more at https://npm.io/package/electron-settings/versions

## 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]

<br/>

### 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).



<br/>
<br/>
<hr/>

<small>**Having trouble?** [Get help on Gitter][external_gitter].</small>





[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

---
_Source: https://npm.io/package/electron-settings · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
