louischatriot/nedb — pull request #168 by negue (2014-05-09 20:05:09+00:00)
Title: Persistence in Browser (localStorage) - closes #124

Basic localStorage Persistence.

What should be also done:

- share basic persistence logic like persistCachedDatabase, treatRawData and so on... , maybe a base class?
- make use of lz-string, localStorage saves the strings internally in UTF-16, but the json strings won't use this 16bit space. with lz-string the storage can be better used.

(See: http://pieroxy.net/blog/pages/lz-string/index.html)
=> this could be done as an extension on Persistence (If you want, I could create a little function + test for that too, in a different pullrequest)

Tests passed:
- Chrome
- Firefox

It failed on my IE11 on W8.1 (localStorage was null, could'nt find a fix for that)

Hope this gets merged. :)