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

@nestjs-redisx/testing

v1.5.0

Published

Testing utilities for NestJS RedisX: an in-memory Redis driver for unit-testing without a running Redis

Readme

@nestjs-redisx/testing

npm npm downloads license

Testing utilities for NestJS RedisX: an in-memory Redis driver that runs the real cache, locks, rate-limit, and idempotency plugins — including their Lua scripts — with no Redis required. Fast, deterministic, isolated unit tests.

Installation

npm install -D @nestjs-redisx/testing

Quick Example

import { Test } from '@nestjs/testing';
import { RedisTestingModule } from '@nestjs-redisx/testing';
import { CachePlugin, CACHE_SERVICE, ICacheService } from '@nestjs-redisx/cache';

const app = await Test.createTestingModule({
  imports: [RedisTestingModule.forRoot({ plugins: [new CachePlugin()] })],
}).compile();
await app.init();

const cache = app.get<ICacheService>(CACHE_SERVICE);

let calls = 0;
const loader = async () => (calls++, { id: 1 });
await cache.getOrSet('user:1', loader, { ttl: 60 });
await cache.getOrSet('user:1', loader, { ttl: 60 });
// calls === 1 — real cache code, no Redis

Prefer to configure RedisModule directly? Import the package (to register the driver) and set global.driver:

import '@nestjs-redisx/testing';
import { RedisModule } from '@nestjs-redisx/core';

RedisModule.forRoot({
  clients: { type: 'single', host: 'localhost', port: 6379 }, // ignored
  global: { driver: 'memory' },
  plugins: [/* ... */],
});

Scope

Supports the data structures and scripting used by the cache, locks, rate-limit, idempotency, and streams plugins: strings, hashes, sets, sorted sets, lists, streams (with consumer groups, PEL, XACK/XCLAIM/XPENDING), keys/TTL, and a bounded Lua interpreter. Single-node semantics only — no cluster cross-slot or Pub/Sub, and blocking reads return promptly rather than waiting.

Documentation

Full documentation: nestjs-redisx.dev/en/reference/testing/

Using with AI Assistants

For better code generation with AI tools (Cursor, Claude Code, GitHub Copilot, etc.), point your agent to the full API reference:

https://nestjs-redisx.dev/llms-full.txt

License

MIT