so basically what I would like to do is read x-json file on my hdd for example and load it into the localstorage of my browser. So far I went with
const localStorageName = 'events';
this.eventList = JSON.parse(localStorage.getItem(localStorageName)) || {};
localStorage.setItem(localStorageName, JSON.stringify(this.eventList));
to save something into the localstorage as a string.
As far as I can think and Iam pretty new to js, json and coding/programming in general, i would have to "unstringify" if that is even a word, the file when loading it and put it back into js right?
Well if it is even possible to load a local file into localstorage that is.
Iam well aware that localstorage can only read/store strings, so it has to be a json file that must be read/load.
Overwriting the data is not an issue. Security is also not an issue.
Why do I want this?
Iam creating a local calendar with an event list/planner but the local cache on the clients are being erased upon shutting down/restarting, so the events are getting erased.
And this has to be offline.
So if this is even possbile any help is highly appreciated!
Thank you in advance.