Skip to content

Expose more raw Keyv functionality to enable better extensions. #36

@lukechilds

Description

@lukechilds

If Keyv (and official storage adapters) were to expose more internals, this would allow for much richer functionality to be built on top of Keyv.

Mainly:

Main thing that comes to mind is a DB migrator (needs access to expiry dates) and keyv-shrink which is currently a fork because the desired functionality couldn't be implemented on top of Keyv.

With the three listed options implemented, keyv-shrink could be implemented efficiently on top of Keyv. All updates to Keyv and Keyv storage adapters would automatically work with keyv-shrink. Example of an implementation could be something like this:

const Keyv = require('keyv');

class KeyvShrink extends Keyv {
  shrink() {
    ...
  }
}

@MySidesTheyAreGone What are your thoughts on this? I'm tied up on client project right now but I'm interested in adding this soon.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions