Closed cooperka closed 7 years ago
I was going to submit a PR for the same thing — I think this would be extremely helpful.
I have an app that relies heavily on memory-cache, and deploys wipe the cache, obviously.
I'm also sure that some apps running under supervisor or nodemon occasionally crash on some unexpected data, and could use this to keep things moving along smoothly.
@ptarjan is this something you'd consider merging? Let me know if there's anything I can improve.
Yeah this sounds reasonable. I might debate on the names and API format once I see it but the overall shape seems broadly useful.
On Mon, Feb 27, 2017 at 1:20 PM Kevin Cooper notifications@github.com wrote:
@ptarjan https://github.com/ptarjan is this something you'd consider merging? Let me know if there's anything I can improve.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/ptarjan/node-cache/pull/83#issuecomment-282857157, or mute the thread https://github.com/notifications/unsubscribe-auth/AACcz7ANhU1XA0V19xwgJCoSDK-JyKyyks5rgz43gaJpZM4MCVAu .
Just kidding, but any potential ETA?
@ptarjan thanks for the feedback, it's updated now.
@ptarjan ping :)
👍
Sorry to ask this, but https://github.com/ptarjan/node-cache/pull/85 submitted before you. Can you rebase on it and match the style they introduced? Thanks.
@ptarjan done!
Awesome library, love the unit tests! I'm using it for caching web response data in a mobile app, and I find import/export to be valuable for saving to disk and restoring the cache later (for example, if you kill the app and then open it again, restore the offline data in case there's no internet anymore).
exportJson = function()
importJson = function(json: string, options: { skipDuplicates: boolean })
export
into the cacheimport
will remain in the cacheskipDuplicates
istrue
options
:skipDuplicates
: Iftrue
, any duplicate keys will be ignored when importing them. Defaults tofalse
.