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 🙏

© 2025 – Pkg Stats / Ryan Hefner

local-redis

v1.0.0

Published

In-memory development Redis server for Node.js and test environments.

Readme

Absolutely! Here’s a clean, professional README.md tailored for an npm package publication. It emphasizes install/usage via Node, npm/yarn, programmatic usage, and CLI compatibility, targeting developers using your package in projects, tests, and CI.


Mock Redis Server (TypeScript)

A blazing-fast, fully-typed, drop-in Node.js Redis server emulator for development, testing, and CI pipelines.
Works with redis-cli, official clients, and all major Node.js frameworks.


✨ Features

  • Plug-and-play, no dependencies required
  • Full in-memory Redis server: Strings, Hashes, Lists, Sets, TTL
  • Pub/Sub (PUBLISH, SUBSCRIBE, UNSUBSCRIBE)
  • Persistence: automatic JSON snapshot on shutdown, SAVE command, or user-config
  • Compatible with redis-cli and most Redis drivers (ioredis, node-redis, Python, etc.)
  • INFO command for monitoring (uptime, memory, keys, stats)
  • Minimal, fully-typed, and easy to extend—ideal for integration testing and local development
  • Graceful shutdown & recovery

🚀 Quick Start

npm install --save-dev @your-scope/mock-redis-server
# or globally for CLI
npm install -g @your-scope/mock-redis-server

Start the server (CLI)

npx mock-redis-server
# or, if installed globally
mock-redis-server

Default port: 6380

With options:

PORT=6379 REDIS_PERSISTENCE=false REDIS_SNAPSHOT_FILE=./myfile.json npx mock-redis-server

Node.js API Example

import { createMockRedisServer } from '@your-scope/mock-redis-server';

const server = createMockRedisServer({
  port: 6380, // default: 6380
  persistence: true, //  default: true
  snapshotFile: './redis_dump.json', // default: ./redis_dump.json
  debug: false, // enable logging (default: false)
});

server.start();

Connect with your favorite Redis client

redis-cli -p 6380

🛠️ Configuration

| ENV / Option | Default | Description | |--------------------------|-------------------|------------------------------------| | PORT | 6380 | Port to listen on | | REDIS_PERSISTENCE | true | Persist state to a JSON file | | REDIS_SNAPSHOT_FILE | ./redis_dump.json | Path for snapshot file | | REDIS_MOCK_DEBUG | false | Enable verbose debug logging |


🗝️ Supported Redis Commands

| Category | Commands | |--------------|-------------------------------------------------| | Strings | SET, GET, DEL | | Expiry | EXPIRE, TTL | | Hashes | HSET, HGET, HGETALL, HDEL | | Lists | LPUSH, RPUSH, LPOP, RPOP, LRANGE | | Sets | SADD, SMEMBERS, SREM | | Pub/Sub | SUBSCRIBE, UNSUBSCRIBE, PUBLISH | | Monitoring | INFO | | Persistence | SAVE | | Utility | PING |


👩‍💻 Example Usage

Strings and Expiry

SET hello world
GET hello
EXPIRE hello 5
TTL hello

Hashes

HSET user:1 name "Jane"
HGET user:1 name
HGETALL user:1

Pub/Sub
(In Terminal 1:)

SUBSCRIBE news

(In Terminal 2:)

PUBLISH news "Update!"

Persistence

SAVE

Monitoring

INFO

🧪 Ideal for...

  • ⚡ Super-fast end-to-end and integration tests—runs locally, no Docker/Redis server needed!
  • 🛠️ CI/CD pipelines: remove external dependencies while keeping Redis API contracts
  • 👩‍💻 Demos, prototypes, workshops, and educational purposes

📝 Notes

  • Memory usage (INFO) reports Node.js process memory—actual heap allocation by all keys plus runtime overhead (see docs).
  • Data is persisted and restored via JSON snapshot at shutdown/startup (unless disabled).
  • Compatible with most Redis commands for Strings, Hashes, Lists, Sets, and Pub/Sub.
  • Production features like AOF, security, cluster, sorted sets (ZSET) not currently implemented.

🤝 Contributing

PRs, feedback, and issues welcome!
Please open an issue or submit a PR to help make this better for the whole community.


📄 License

MIT © Pranav Bagal


Enjoy zero-hassle Redis server compatibility for your local dev, CI, and tests!