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

@idioteque/redis

v0.1.1

Published

Redis store implementation for idioteque

Readme

@idioteque/redis

Redis store implementation for idioteque workers. Provides persistent, distributed storage for execution state and task results using Redis.

Features

  • 💾 Persistent storage - Execution state survives application restarts
  • 🌐 Distributed - Multiple worker instances can share the same Redis store
  • 🧹 Automatic cleanup - Optional TTL support to prevent storage bloat
  • 📦 JSON serialization - Automatic serialization/deserialization of task results
  • 🔧 Multi-client support - Compatible with ioredis, node-redis, and Upstash Redis
  • ⚠️ Error handling - Detailed error messages for debugging serialization issues

Installation

npm install @idioteque/redis ioredis

Usage

import { Redis } from 'ioredis';
import { createRedisStore } from '@idioteque/redis';
import { createWorker } from 'idioteque';

const redis = new Redis(process.env.REDIS_URL);
const store = createRedisStore(redis, { ttl: 86400000 }); // 24 hours

const worker = createWorker({
  store,
  // ... other options
});

API

createRedisStore(redis, options?)

Creates a Redis-backed store for idioteque workers.

Parameters:

  • redis: RedisImpl - Redis client instance (supports ioredis, node-redis, or any Redis-compatible client)
  • options?: { ttl?: number } - Optional configuration
    • ttl - Time-to-live for keys in milliseconds (default: no expiration)

Returns: WorkerStore

Supported Redis Clients

The store accepts any Redis client that implements the RedisImpl interface:

interface RedisImpl {
  set(key: string, value: string): Promise<any>;
  get(key: string): Promise<unknown | null>;
  hset(key: string, kv: { [field: string]: string }): Promise<any>;
  hget(key: string, field: string): Promise<unknown | null>;
  hdel(key: string, field: string): Promise<any>;
  hgetall(key: string): Promise<Record<string, unknown> | string[] | null>;
  del(key: string): Promise<any>;
  expire(key: string, seconds: number): Promise<any>;
}

Examples

With ioredis:

import { Redis } from 'ioredis';
import { createRedisStore } from '@idioteque/redis';

const redis = new Redis({
  host: 'localhost',
  port: 6379,
});

const store = createRedisStore(redis);

With Upstash Redis:

import { Redis } from '@upstash/redis';
import { createRedisStore } from '@idioteque/redis';

const redis = new Redis({
  url: process.env.UPSTASH_REDIS_REST_URL,
  token: process.env.UPSTASH_REDIS_REST_TOKEN,
});

const store = createRedisStore(redis);

With TTL (automatic cleanup):

const store = createRedisStore(redis, {
  ttl: 24 * 60 * 60 * 1000 // 24 hours in milliseconds
});

Redis Key Structure

The store uses the following Redis key patterns:

  • {executionId} - Tracks active executions
  • {executionId}-transactions - Hash of in-progress tasks
  • {executionId}-results - Hash of completed task results

All keys automatically expire based on the configured TTL (if provided).

Development

Running Redis for Tests

This package includes a Docker Compose configuration for running Redis during development:

# Start Redis container
pnpm redis:up

# Run tests (requires Redis to be running)
pnpm test

# Run tests with automatic Redis container management
pnpm test:redis

# Stop Redis container
pnpm redis:down

# View Redis logs
pnpm redis:logs

Requirements

  • Docker and Docker Compose for running tests
  • Node.js 16+
  • TypeScript 5.0+