sindresorhus / electron-store

Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc
MIT License
4.57k stars 148 forks source link

Cannot change file name, it is marked readonly #264

Open crystalfp opened 1 year ago

crystalfp commented 1 year ago

First attempt at electron-store. I need to have two different files, so I tried to setup the name in the constructor this way (as explained in the documentation:

const options: Store.Options<Record<string, unknown>> = {};
options.name = "preferences";

But Typescript complains: Cannot assign to 'name' because it is a read-only property. What should I do? Thanks! mario