Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-settings

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-settings

User settings manager for Electron

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
decreased by-12.94%
Maintainers
1
Weekly downloads
 
Created
Source

ElectronSettings

Save settings to a disk and load them in when your app starts. A user settings manager for Electron, adapted from Atom/config.

Requires Electron 0.35.0 or above.


Usage

new ElectronSettings([options])

Arguments

  • options (Object) - Custom options for this ElectronSettings instance.

    • options.configDirPath (string) - Absolute path to the directory where you'd like to save your settings.json file. By default this is in your user data directory. See app.getPath('userData').

    • options.configFileName (string) - The file name for your settings file. By default this is settings. Omit the .json extension.

    • options.debouncedSaveTime (number) - The maximum amount of time in milliseconds that must elapse before saving to disk. Default 100

Example

To use electron-settings, first import the class, then create a new electron-settings instance:

const ElectronSettings = require('electron-settings');

let settings = new ElectronSettings();

console.log(settings.getConfigFilePath());
// => /Users/Nathan/Library/Application Support/Electron/electron-settings/settings.json

This will automatically generate a settings.json file in your user data directory if one does not exist. If the file already exists, it will be imported.


Documentation

Contributors

License

MIT

Keywords

FAQs

Package last updated on 11 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc