Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load() methods #18

Closed
mikeal opened this issue Mar 24, 2013 · 5 comments
Closed

load() methods #18

mikeal opened this issue Mar 24, 2013 · 5 comments

Comments

@mikeal
Copy link

mikeal commented Mar 24, 2013

We have .dump() and .dumpLRU, would be nice if you could do something like.

var lru = require('lru-cache').load(JSON.parse(fs.readFileSync('./dump.json').toString()))

Maybe a matching one for loadLRU.

@isaacs
Copy link
Owner

isaacs commented Mar 25, 2013

Yes, that'd be nice.

@isaacs
Copy link
Owner

isaacs commented Apr 3, 2013

I looked into this a tiny bit, and it's surprisingly tricky to get right. You have to serialize not just the cache entries and lru list, but all the counters and whatnot as well.

@satazor
Copy link

satazor commented May 26, 2013

This would be very useful, making lru persistant in disk.

@johann8384
Copy link

It seems useful on the surface, but it's probably not really all THAT useful, because if you need/want it to persist to disk, then another tool is probably better suited. Something like MemcacheDB or Redis.

@isaacs
Copy link
Owner

isaacs commented Nov 27, 2015

This was added in #40.

@isaacs isaacs closed this as completed Nov 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants