kapouer / node-lfu-cache

Least Frequently Used cache with optional decay
MIT License
13 stars 2 forks source link

Added serializability functionality #2

Open rajatjain1997 opened 7 years ago

rajatjain1997 commented 7 years ago

Some users might need an import/export functionality for the current LFUCache data-structure for portability/transmission over get/post requests and storage.

Added:

import(): To import and set an already existing LFUCache export(): To export an already existing LFUCache as string

Additional dependencies: circular-json to parse and stringify Circular referenced JSON Objects.

rajatjain1997 commented 7 years ago

@kapouer Can you please review the request?

kapouer commented 7 years ago

Well i've asked a question above !

rajatjain1997 commented 7 years ago

I'm not able to view any other comments except for the one above... Can you please post it again?

kapouer commented 7 years ago

Oops, sorry i'm not that used to the github review gui.

rajatjain1997 commented 7 years ago

@kapouer is the checking needed?

kapouer commented 7 years ago

Well i miss some time to fully review your changes - and more importantly, to write some tests to make sure they won't break anything. I'm also not sure casting unconditionally is a good idea.