I’m trying to read a levelDb database from Chrome’s local storage. The idea is not to do this in the browser but from a node script.
So via the ‘level’ library I’ve been able to open the database and I can read all the data via :
for await (const dt of db.iterator()) {
console.log(`Data: ${dt}`);
}
The problem is that the data is organised in ‘sublevel’ but this doesn’t seem to have the same standard as npm’s ‘level’ library.
Here is an example of a sublevel database created with the ‘level’ library:
!https://www.twitch.tv!session_test,true
And here is how I have it in the local storage db from Chrome:
_https://www.twitch.tvsession_test,true
Knowing that there is this at the beginning of the file which seems to allow you to distinguish the sublevel from the key (there are many unknown characters, this is not a Stackoverflow bug):
META:https://www.twitch.tv��������
What’s more, according to my research it seems that on the chrome side the db is encoded in utf16 which the npm library doesn’t support.
Source
I can obviously parse and retrieve the data but I’d like to be able to use the get to retrieve a particular piece of data.
Also there is only one key that is not in a sub level and I’m able to get the value via the get methods, so it really a problem of sublevel syntax I think
1