-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple settings files? #92
Comments
Hi @stavlocker, I'm afraid this capability does not currently exist and there are no current plans to implement it in the near future. So that I can get a sense of how a feature like this would be used, may I ask how multiple settings files would be ideal for your project and how having one does not work for you? Thanks :) |
@nathanbuchar Well, an example might be saving data, and not only settings - I could have my |
I can certainly understand wanting to split data into their own files, but with electron-settings you could just scope settings within their own key or namespace, like so: settings.set('config', {
isLoggedIn: true,
username: 'nathanbuchar'
});
settings.set('cupcakes', [
'Red Velvet',
'Vanilla',
'Chocolate'
]);
settings.get('config.isLoggedIn'); // true
settings.get('cupcakes')[0]; // 'Red Velvet' If you're still keen on having different files for each config, check out electron-json-storage. There, each key is its own JSON file—there's no concept of "key paths". It's kind of like a re-implementation of LocalStorage, where a JSON file is created for each key. |
@nathanbuchar Maybe an unexpected error occurred while write, It may cause damage for file, also there are many possible causes for data damage. so which will cause all data to be lost. |
I know this is super old, but if anyone else needs this, I have gone for creating a backup after and before critical changes are made in the application. I then have a simple function which looks for setting on startup, if they are not there, then copy this file in place of setting and voila, setting are back :) :
|
Hi. Great project!
Could it be possible for us to use multiple settings files? It'd make this project ideal for me.
Thanks in advance!
The text was updated successfully, but these errors were encountered: