sindresorhus / electron-store

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

More general name needed #4

Closed leo closed 7 years ago

leo commented 7 years ago

IMHO, this package can be used for either the config or just for saving/caching data (like we're doing it in Now Desktop). Because of this, I recommend renaming it.

My suggestion is "electron-store" (the package name is available on npm).

danielnieto commented 7 years ago

that's what I think too... I do not want to store config, but some cached data

teameh commented 7 years ago

It works great as a persistent store!

But is that the way it's meant to be used? Doesn't it write your changes to disk everytime you set something, and won't it read the file back in every time you get something? That is not very efficient for a store right? Or shouldn't we worry too much about that? Something with premature-optimization being evil 😈 ?

Upside is of course that it gives you persistence even when your app is abruptly terminated 😄

sindresorhus commented 7 years ago

@leo Done at last. Thanks for the idea.

@teameh It shouldn't be a problem for most use-cases. Fs isn't that slow. And synchronous fs is faster than async, because async has overhead with event-loop. Async would indeed be a premature-optimization. If you encounter the need to use it in a hot code path, you could always set everything at once with .set(object).

leo commented 7 years ago

Wonderful new name! ❤️

prajapati-parth commented 6 years ago

Would this have any impact on projects that used electron-config. Should any migration steps be followed? Because npm still has a package named electon-config.

Thanks.