Registry / database / redis-fast-driver

redis-fast-driver

JSON →
library2.2.6jsnpmunverified

A high-performance Redis client for Node.js built on top of the hiredis C async library, providing near-native speed for pipelining and raw commands. Version 2.2.6 is the latest stable release, with infrequent updates. It supports ES6 promises via rawCallAsync, automatic reconnection, and all Redis commands including PUB/SUB and MONITOR. Unlike ioredis or node-redis, it focuses on minimal overhead and simplicity, making it suitable for high-throughput production environments. The driver has been battle-tested at 30k ops/sec per instance. Ships TypeScript definitions.

npm install redis-fast-driver
INSTALL
IMPORT
SIG · REDIS-FAST-DRIVER
R
redis-fast-driver
databasejavascriptv2.2.6
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.

default
import Redis from 'redis-fast-driver'
import { Redis } from 'redis-fast-driver'
Package exports a default class, not named export.
default (CommonJS)
const Redis = require('redis-fast-driver')
const { Redis } = require('redis-fast-driver')
CommonJS require returns the constructor directly.
TypeScript type (if needed)
import Redis from 'redis-fast-driver'
Types are included; no separate type import needed.

Creates a Redis client, connects, performs SET and GET commands, and closes the connection.

import Redis from 'redis-fast-driver'; const client = new Redis({ host: process.env.REDIS_HOST ?? '127.0.0.1', port: parseInt(process.env.REDIS_PORT ?? '6379'), auth: process.env.REDIS_PASSWORD ?? undefined, db: parseInt(process.env.REDIS_DB ?? '0'), maxRetries: 10, reconnectTimeout: 1000, connectTimeout: 5000, }); client.on('ready', () => { console.log('Redis ready'); client.rawCall(['set', 'foo', 'bar'], (err, resp) => { if (err) throw err; console.log('SET response:', resp); client.rawCall(['get', 'foo'], (err, resp) => { if (err) throw err; console.log('GET response:', resp); client.end(); }); }); }); client.on('error', (err) => { console.error('Redis error:', err); }); client.on('end', () => { console.log('Redis connection closed'); });
Debug
Known issues
gotchaThe driver does not support automatic parsing of Redis responses into JavaScript types beyond basic conversions (string, number, array, null). For example, GET returns a string even if the value looks like a number.
fix
Manually cast types as needed, e.g., using parseInt() on GET results for numeric values that were not set via INCR.
affects: >=2.0.0
deprecatedThe option `doNotRunQuitOnEnd` is deprecated and may be removed in future versions. Use `end()` without sending QUIT by setting `doNotRunQuitOnEnd: true`.
fix
Set `doNotRunQuitOnEnd: true` if you don't want the driver to send QUIT on end().
affects: >=2.2.0
breakingIn version 2.0.0, the package changed from callbacks-only to supporting Promises via `rawCallAsync`. The callback signature for `rawCall` remains unchanged.
fix
For Promise support, use `rawCallAsync` instead of `rawCall`. Callbacks continue to work.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Please install hiredis
The peer dependency `hiredis` is not installed. The driver requires it for protocol parsing.
fix
Run `npm install hiredis` alongside the driver.
RedisClient is not a constructor
Trying to import a named export `{ Redis }` instead of the default export.
fix
Use `import Redis from 'redis-fast-driver'` or `const Redis = require('redis-fast-driver')`.
UnhandledPromiseRejectionWarning: Error: Redis connection refused
The driver is unable to connect to the Redis server at the specified host/port.
fix
Ensure Redis server is running and accessible. Check host, port, and any firewall rules.
Upgrade
Version history
2.2.6latest on npm
Audit
Dependencies
hiredisrequiredUsed for the underlying C async Redis protocol parsing and connection handling.
Agent activity
17 hits · last 30 days
node
14
Meta
1
Resources
redis-fast-driver — npm install redis-fast-driver · libregistry