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

@uploadista/kv-store-bun

v0.1.0

Published

Bun Redis KV store for Uploadista

Readme

@uploadista/kv-store-bun

Bun Redis KV store adapter for Uploadista. Uses Bun's native Redis client for high-performance key-value storage.

Requirements

  • Runtime: Bun (this package only works in Bun runtime, not Node.js)
  • Redis: Version 7.2 or higher

Installation

pnpm add @uploadista/kv-store-bun

Usage

Basic Usage

import { RedisClient } from "bun";
import { makeBunBaseKvStore } from "@uploadista/kv-store-bun";
import { Effect } from "effect";

// Create a Bun Redis client
const redis = new RedisClient("redis://localhost:6379");

// Create the KV store
const store = makeBunBaseKvStore({ redis });

// Use the store
const program = Effect.gen(function* () {
  // Set a value
  yield* store.set("user:123", JSON.stringify({ name: "John" }));

  // Get a value
  const value = yield* store.get("user:123");
  console.log(value); // '{"name":"John"}'

  // Delete a value
  yield* store.delete("user:123");

  // List keys with prefix
  const keys = yield* store.list!("user:");
  console.log(keys); // ['123', '456', ...]
});

await Effect.runPromise(program);

With Effect Layer

import { RedisClient } from "bun";
import { bunKvStore } from "@uploadista/kv-store-bun";
import { BaseKvStoreService } from "@uploadista/core/types";
import { Effect, Layer } from "effect";

const redis = new RedisClient("redis://localhost:6379");

// Create the layer
const kvStoreLayer = bunKvStore({ redis });

// Use in your program
const program = Effect.gen(function* () {
  const store = yield* BaseKvStoreService;
  yield* store.set("key", "value");
  const value = yield* store.get("key");
  return value;
}).pipe(Effect.provide(kvStoreLayer));

await Effect.runPromise(program);

API Reference

makeBunBaseKvStore(config)

Creates a BaseKvStore instance using Bun's Redis client.

Parameters:

  • config.redis - A Bun RedisClient instance

Returns: BaseKvStore

bunKvStore(config)

Creates an Effect Layer that provides BaseKvStoreService.

Parameters:

  • config.redis - A Bun RedisClient instance

Returns: Layer<BaseKvStoreService>

BunKvStoreConfig

Configuration interface for the Bun KV store.

interface BunKvStoreConfig {
  redis: RedisClient;
}

BaseKvStore Interface

The store implements the standard BaseKvStore interface:

| Method | Description | |--------|-------------| | get(key) | Retrieves a value by key, returns null if not found | | set(key, value) | Stores a string value with the given key | | delete(key) | Removes a value by key | | list(keyPrefix) | Lists all keys matching the prefix (prefix is stripped from results) |

Performance

Bun's native Redis client offers significant performance benefits over Node.js alternatives:

  • ~6x faster than @redis/client or ioredis
  • Built-in automatic pipelining
  • Zero external dependencies (part of Bun runtime)
  • Native async/await support

Limitations

  • Bun runtime only: This package will not work in Node.js or other runtimes
  • Redis 7.2+: Requires Redis server version 7.2 or higher
  • No Cluster support: Bun's Redis client does not support Redis Cluster
  • No Sentinel support: Bun's Redis client does not support Redis Sentinel

Related Packages

  • @uploadista/kv-store-redis - For Node.js with @redis/client
  • @uploadista/kv-store-ioredis - For Node.js with ioredis
  • @uploadista/kv-store-memory - In-memory store for testing

License

MIT