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

@thzero/library_server_repository_redis_ioredis

v0.19.1

Published

![GitHub package.json version](https://img.shields.io/github/package-json/v/thzero/library_server_repository_redis_ioredis) ![David](https://img.shields.io/david/thzero/library_server_repository_redis_ioredis) [![License: MIT](https://img.shields.io/badge

Downloads

277

Readme

GitHub package.json version David License: MIT

library_server_repository_redis_ioredis

Binds ioredis to the Redis repository base in @thzero/library_server_repository_redis.

This is a thin package: it implements the one abstract method the base leaves open. Connection caching, the config lookup and the open-once mutex all live in the base.

Requirements

NodeJs

NodeJs version 22+

Redis

A reachable Redis server. username requires Redis 6 or later.

Installation

NPM

npm install @thzero/library_server_repository_redis_ioredis

Peer dependencies

  • @thzero/library_common
  • @thzero/library_common_service
  • @thzero/library_server
  • @thzero/library_server_repository_redis

What it provides

index.js — default export IoredisRedisRepository, extending RedisRepository. It implements _initializeClientConnection(correlationId, connectionInfo, clientName, config) and nothing else; everything in the base is inherited unchanged.

Two connection shapes are supported, chosen by whether connectionInfo.port is set:

| connectionInfo | Built as | |---|---| | has a port | new Redis({ port, host, username, password, db, enableReadyCheck: false }) | | anything else | new Redis(connectionInfo, { enableReadyCheck: false }) — so a connection string or a full ioredis options object passes straight through |

enableReadyCheck is forced to false in both cases. Some managed Redis providers do not permit the INFO command that the ready check issues.

openSource.js — a default-exported function returning the licence manifest for this package and its dependencies, for an application's open-source attribution page.

Configuration

Read by the base from db.redis.connection:

{
    "app": {
        "db": {
            "redis": {
                "connection": {
                    "host": "127.0.0.1",
                    "port": 6379,
                    "username": "<username>",
                    "password": "<password>",
                    "db": 0
                }
            }
        }
    }
}

Or as a connection string, which takes the second branch above:

{ "app": { "db": { "redis": { "connection": "redis://user:[email protected]:6379/0" } } } }

Override getClientName() to read a different db.* block.

Wiring it up

import BaseRedisRepository from '@thzero/library_server_repository_redis_ioredis/index.js';

class RegistryRepository extends BaseRedisRepository {
    async publish(correlationId, channel, message) {
        const client = await this._getClient(correlationId);
        await client.publish(correlationId, channel, JSON.stringify(message));
    }
}

Register it with the injector from _initRepositories in your BootMain derived class, or from a boot plugin's initRepositories.

A note on error handling

_initializeClientConnection returns the client as ioredis constructs it, with no error listener attached. ioredis emits error on a failed or dropped connection, and an unhandled error event terminates the process — attach a handler in your subclass if you want the application to survive Redis being unreachable.

Development

npm run lint       # eslint .
npm run lint:fix   # eslint . --fix
npm test           # node --test "test/*.test.js"