Tagged Keyv Wrapper

A powerful extension of Keyv that adds tag-based cache invalidation and management capabilities.

Documentation

Why I built Tagged Keyv Wrapper

@keyvhq/core is a great key-value storage library, but it lacks a native way to invalidate multiple keys based on a shared topic or category. This wrapper was built to add robust tagging support for smarter, scoped cache management.

What Tagged Keyv Wrapper does

It wraps a `@keyvhq/core` instance, allowing you to associate one or more tags with each cache entry. This enables you to perform bulk operations, such as invalidating or retrieving all entries associated with a specific tag, without affecting the rest of the cache.

Who benefits from Tagged Keyv Wrapper

Developers using the Keyv ecosystem for caching in applications that need smart, targeted invalidation, such as GraphQL APIs, content management systems, or multi-tenant platforms.


Core Features

Drop-in replacement

for `@keyvhq/core` with full backward compatibility

Tag-based invalidation

Organize cache entries with tags and invalidate them in bulk

Memory efficient

Automatic compaction and dead key removal

Concurrency safe

Built-in locking prevents race conditions

Extensible architecture

Pluggable TagManager interface for different storage backends

Full TypeScript support

Complete type safety with generics