npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kb-labs/adapters-redis

v2.94.0

Published

Redis adapter implementing ICache interface

Readme

@kb-labs/adapters-redis

Part of KB Labs ecosystem. Works exclusively within KB Labs platform.

High-performance distributed cache adapter using Redis with TTL, patterns, and atomic operations.

Overview

| Property | Value | |----------|-------| | Implements | ICache | | Type | core | | Requires | None | | Category | Cache |

Features

  • TTL Support - Automatic key expiration
  • Pattern Operations - Scan and delete by pattern
  • Atomic Operations - Increment, decrement, compare-and-set
  • Key Prefixing - Namespace isolation
  • Connection Pooling - Efficient connection management

Installation

pnpm add @kb-labs/adapters-redis

Configuration

Add to your kb.config.json:

{
  "platform": {
    "adapters": {
      "cache": "@kb-labs/adapters-redis"
    },
    "adapterOptions": {
      "cache": {
        "host": "localhost",
        "port": 6379,
        "keyPrefix": "kb:"
      }
    }
  }
}

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | host | string | "localhost" | Redis server host | | port | number | 6379 | Redis server port | | keyPrefix | string | "kb:" | Prefix for all cache keys | | password | string | - | Redis password (optional) |

Usage

Via Platform (Recommended)

import { usePlatform } from '@kb-labs/sdk';

const platform = usePlatform();

// Set with TTL (60 seconds)
await platform.cache.set('user:123', { name: 'John' }, 60000);

// Get
const user = await platform.cache.get<User>('user:123');

// Delete
await platform.cache.delete('user:123');

// Clear all with pattern
await platform.cache.deletePattern('user:*');

Standalone (Testing/Development)

import { createAdapter } from '@kb-labs/adapters-redis';

const cache = createAdapter({
  host: 'localhost',
  port: 6379,
  keyPrefix: 'test:'
});

await cache.set('key', 'value', 60000);
const value = await cache.get('key');

Adapter Manifest

{
  id: 'redis-cache',
  name: 'Redis Cache',
  version: '1.0.0',
  implements: 'ICache',
  capabilities: {
    custom: {
      ttl: true,
      patterns: true,
      atomic: true,
    },
  },
}

FAQ

Add password to config:

{
  "adapterOptions": {
    "cache": {
      "host": "redis.example.com",
      "port": 6379,
      "password": "your-password"
    }
  }
}

For cluster mode, use connection string format:

{
  "adapterOptions": {
    "cache": {
      "url": "redis://node1:6379,node2:6379,node3:6379"
    }
  }
}

Related Adapters

| Adapter | Use Case | |---------|----------| | @kb-labs/adapters-eventbus-cache | Event bus using cache backend |

License

KB Public License v1.1 - KB Labs Team