Registry / database / redis-pooling

redis-pooling

JSON →
library1.0.11jsnpmunverified

redis-pooling is a Node.js module for creating Redis connection pools, handling multiple clients efficiently. Current stable version is 1.0.11. Release cadence is low, with no recent updates. It allows limiting and reusing Redis connections to avoid exhaustion of connections on the Redis server. Key differentiators include simple API for pooling connections compared to generic connection pool libraries. Not to be confused with the official node-redis pool feature (which is now built-in). Consider using ioredis's built-in connection management instead.

npm install redis-pooling
INSTALL
IMPORT
SIG · REDIS-POOLING
R
redis-pooling
databasejavascriptv1.0.11
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisPool
import { RedisPool } from 'redis-pooling'
const { RedisPool } = require('redis-pooling')
Can use both ESM and CJS. Ensure redis is installed separately.
createPool
import { createPool } from 'redis-pooling'
import RedisPool from 'redis-pooling'
createPool is a named export; default export does not exist.
default import (mistake)
import { RedisPool } from 'redis-pooling'
import RedisPool from 'redis-pooling'
This package has no default export; users often mistakenly use default import.

Creates a Redis connection pool with up to 10 clients, acquires a client to set a key, then releases it back to the pool.

import { createPool } from 'redis-pooling'; import redis from 'redis'; const pool = createPool({ host: process.env.REDIS_HOST ?? 'localhost', port: parseInt(process.env.REDIS_PORT ?? '6379'), max_clients: 10 }); pool.acquire((err, client) => { if (err) { console.error(err); return; } client.set('key', 'value', (err) => { if (err) console.error(err); pool.release(client); }); });
Debug
Known issues
deprecatedThis package is not actively maintained and may have compatibility issues with newer redis versions.
fix
Consider using ioredis built-in connection pool or generic-pool with redis client directly.
affects: >=1.0.0
gotchamax_clients option name is inconsistent with other pooling libraries (usually max).
fix
Use max_clients in config object.
affects: >=1.0.0
gotchaCallbacks are used; does not support Promises or async/await natively.
fix
Wrap acquire and release in a Promise manually, or use util.promisify.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server not running or wrong host/port.
fix
Start Redis server on localhost:6379 or set environment variables REDIS_HOST and REDIS_PORT.
TypeError: pool.acquire is not a function
Misimport: using default import instead of named import createPool.
fix
Use 'import { createPool } from 'redis-pooling'' instead of default import.
Upgrade
Version history
1.0.11latest on npm
Audit
Dependencies
redisrequiredpeer dependency - requires the redis client library to create connections
Agent activity
20 hits · last 30 days
node
16
Meta
1
Amazon
1
Resources
redis-pooling — npm install redis-pooling · libregistry