Skip to main content

@baeta/extension-cache-keyv

Classes

KeyvStore

Keyv-based cache store implementation.

Remarks

Not recommended for production environments with high query volumes. Consider using Redis or Upstash for production deployments.

Example

import { KeyvStore } from "@baeta/extension-cache-keyv";
import Keyv from "keyv";

const keyv = new Keyv();
const store = new KeyvStore(keyv);

// Use with cache extension
const cacheExt = cacheExtension(store, {
ttl: 3600,
});

Extends

  • Store

Constructors

new KeyvStore()

new KeyvStore(keyv): KeyvStore

Parameters
ParameterType

keyv

Keyv<any>

Returns

KeyvStore

Overrides

Store.constructor

Properties

PropertyModifierType

keyv

protected

Keyv<any>

Methods

createStoreAdapter()

createStoreAdapter<T>(options, type, hash): StoreAdapter<T>

Creates a new store adapter for a specific type

Type Parameters
Type Parameter

T

Parameters
ParameterTypeDescription

options

StoreOptions<T>

Store configuration options

type

string

Type name for the cached items

hash

string

Unique hash for the type

Returns

StoreAdapter<T>

Overrides

Store.createStoreAdapter