electron-settings

4.0.4last stable release 9 months ago
Complexity Score
Medium
Open Issues
27
Dependent Projects
811
Weekly Downloadsglobal
5,880

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

Electron Settings

A simple and robust settings management library for Electron.

Born from Atom’s original internal configuration manager and the settings manager of choice for Electron’s own API Demos app, Electron Settings allows you to persist user settings and other data between app loads simply and easily.


Install

npm install electron-settings

Demo

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 for more info.

new BrowserWindow({
  webPreferences: {
    enableRemoteModule: true // <-- Add me
  }
});

API Docs

API docs and can be found at electron-settings.js.org.



Having trouble? Get help on Gitter.

Dependencies

CVE IssuesActive
0
Scorecards Score
1.50
Test Coverage
No Data
Follows Semver
Yes
Github Stars
816
Dependenciestotal
23
DependenciesOutdated
16
DependenciesDeprecated
2
Threat Modelling
No
Repo Audits
No

Learn how to distribute electron-settings in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install electron-settings
Processing...
Done

47 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.