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 - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

24

docs/api/events.md

@@ -7,2 +7,3 @@ Events

* [`save`][event_save]
* [`create`][event_create]

@@ -86,10 +87,33 @@

***
create
-----
**`settings.on('create', handler)`**
Called when the settings file has been create on disk, e.g. on first run.
**Example**
```js
function handleCreate() {
console.log('Settings file created');
}
settings.on('create', handleCreate);
```
[event_change]: #change
[event_error]: #error
[event_save]: #save
[event_create]: #create

@@ -81,2 +81,11 @@ /**

/**
* Internal created event handler.
*
* @see _handleCreate
* @type {Function}
* @private
*/
this._onCreate = this._handleCreate.bind(this);
/**
* Internal change event handler.

@@ -175,2 +184,3 @@ *

fs.outputJsonSync(configFilePath, {});
this._emitCreateEvent();

@@ -205,2 +215,3 @@ debug('config file generated at ' + configFilePath);

_setupInternalEventBindings() {
this.on(Settings.Events.CREATE, this._onCreated);
this.on(Settings.Events.CHANGE, this._onChange);

@@ -212,2 +223,11 @@ this.on(Settings.Events.SAVE, this._onSave);

/**
* Called when the "created" event fires.
*
* @private
*/
_handleCreate() {
debug('settings file created');
}
/**
* Called when the "change" event fires. This checks the watch list for any

@@ -541,2 +561,12 @@ * watched keys and calls their respective watch handlers if the changed key

/**
* Triggers the "created" event.
*
* @emits ElectronSettings#save
* @private
*/
_emitCreateEvent() {
this.emit(Settings.Events.CREATE);
}
/**
* Triggers the "change" event.

@@ -582,2 +612,3 @@ *

this.removeListener(Settings.Events.CREATE, this._onCreate);
this.removeListener(Settings.Events.CHANGE, this._onChange);

@@ -592,2 +623,3 @@ this.removeListener(Settings.Events.SAVE, this._onSave);

this._debouncedSave = null;
this._onCreate = null;
this._onChange = null;

@@ -629,2 +661,3 @@ this._onError = null;

Settings.Events = {
CREATE: 'create',
CHANGE: 'change',

@@ -631,0 +664,0 @@ ERROR: 'error',

18

package.json
{
"name": "electron-settings",
"version": "1.0.4",
"version": "1.1.0",
"description": "User settings manager for Electron",

@@ -15,4 +15,18 @@ "main": "index.js",

],
"repository": "https://github.com/nathanbuchar/electron-settings",
"repository": {
"type": "git",
"url": "https://github.com/nathanbuchar/electron-settings"
},
"author": "Nathan Buchar <hello@nathanbuchar.com>",
"contributors": [
{
"name": "Nathan Buchar",
"email": "hello@nathanbuchar.com",
"web": "http://nathanbuchar,com/"
},
{
"name": "Kai Eichinger",
"email": "kai.eichinger@outlook.com"
}
],
"license": "ISC",

@@ -19,0 +33,0 @@ "dependencies": {

3

README.md

@@ -57,5 +57,6 @@ ElectronSettings

Authors
Contributors
-------
* [Nathan Buchar](mailto:hello@nathanbuchar.com)
* [Kai Eichinger](mailto:kai.eichinger@outlook.com)

@@ -62,0 +63,0 @@

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