Registry / database / ioredis-auto-pipeline

ioredis-auto-pipeline

JSON →
library1.0.2jsnpmunverified

Automatic Redis pipeline support for ioredis. Version 1.0.2. This library transparently batches Redis commands into pipelines to increase throughput by up to 100% without code changes. It supports all built-in commands except subscribe and psubscribe. Ideal for high-throughput Node.js applications using ioredis. The library wraps an ioredis instance and automatically queues commands, executing them in batches. Maintenance is minimal as the API is simple and the library is stable.

npm install ioredis-auto-pipeline
INSTALL
IMPORT
SIG · IOREDIS-AUTO-PIPEL
I
ioredis-auto-pipeline
databasejavascriptv1.0.2
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.

auto
const auto = require('ioredis-auto-pipeline')
import auto from 'ioredis-auto-pipeline'
This package uses CommonJS; default import with ES modules will not work without a default export.
auto (ESM compatibility)
import auto from 'ioredis-auto-pipeline'
As of version 1.0.2, the package does not provide an ESM export. Use dynamic import or transpilation.
wrapped Redis instance
const redis = auto(new Redis())
const redis = new Redis()
You must wrap the ioredis instance with the auto function to enable automatic pipelining.

Creates a wrapped ioredis instance that automatically pipelines commands, demonstrating set, get, incr, and lpush.

const Redis = require('ioredis') const auto = require('ioredis-auto-pipeline') async function run() { const redis = auto(new Redis({ host: process.env.REDIS_HOST || 'localhost', port: process.env.REDIS_PORT || 6379 })) // Schedule multiple commands const results = await Promise.all([ redis.set('key1', 'value1'), redis.get('key1'), redis.incr('counter'), redis.lpush('list', 'item') ]) console.log(results) await redis.quit() } run().catch(console.error)
Debug
Known issues
gotchaCommands 'subscribe' and 'psubscribe' are not supported and will not be pipelined.
fix
Avoid using subscribe/psubscribe with auto-pipeline; use ioredis directly for pub/sub.
affects: 1.0.2
gotchaThe auto-pipeline may delay individual command execution until the batch is flushed, potentially increasing latency for low-throughput scenarios.
fix
For latency-sensitive commands, consider using ioredis directly without auto-pipeline.
affects: 1.0.2
gotchaAutomatic pipelining may cause unexpected order of execution if commands are interleaved with non-pipelined operations.
fix
Ensure all Redis operations go through the wrapped instance to maintain ordering.
affects: 1.0.2
Errors
Common errors & fixes
TypeError: auto is not a function
Incorrect import: using ES module import syntax with CommonJS package.
fix
Use require('ioredis-auto-pipeline') instead of import.
Error: Cannot find module 'ioredis'
ioredis is not installed as a peer dependency.
fix
Run 'npm install ioredis' in your project.
RedisError: ERR wrong number of arguments for 'subscribe' command
Using subscribe command with auto-pipeline, which does not support it.
fix
Use ioredis directly (not wrapped) for pub/sub commands.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
ioredisrequiredPeer dependency; the wrapper requires an ioredis instance.
Agent activity
8 hits · last 30 days
node
8
Resources
ioredis-auto-pipeline — npm install ioredis-auto-pipeline · libregistry