lmaccherone/node-localstorage

Use a single file as storage

Radiergummi opened this issue · 0 comments

Maybe the case is a bit special for me, but I wrote my own little localStorage abstraction that writes index keys (here). Those index keys end in an asterisk to indicate they contain all keys below. Now as you might know, using an asterisk in a filename is prone to errors, and after trying out node-localStorage for my server-side tests (setting up PhantomJS for such a dumb little module is way too much work), it failed as I almost expected it to.
Therefore, I wanted to know why you use separate files for the keys anyhow, not a single one. That'd prevent problems with obscure key names and huge numbers of files for many keys in the storage too.
To get around this, I wrote my own dead simple localStorage emulation (localStorageMock.js) that does just this.

So I'm just leaving this as a suggestion 😊