Registry / database / node-redis-dump2

node-redis-dump2

JSON →
library0.6.0jsnpmunverified

Backup and restore Redis data using Node.js. This package version 0.6.0 is a maintained fork of node-redis-dump (originally by Dmitriy Yurchenko) that applies bugfixes and security updates. It works with ioredis client and supports export/import of Redis keys in various formats (redis, json). Release cadence is low; no recent updates. Key differentiator: it provides a simple dump/restore mechanism for Redis, but does not support Redis streams or binary data in 'redis' type.

npm install node-redis-dump2
INSTALL
IMPORT
SIG · NODE-REDIS-DUMP2
N
node-redis-dump2
databasejavascriptv0.6.0
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.

RedisDump
const RedisDump = require('node-redis-dump2')
import RedisDump from 'node-redis-dump2'
This package does not provide ES module exports; only CommonJS require() works.
dump.export()
let dump = new RedisDump({...}); dump.connect(); dump.export({type:'redis', callback: fn});
dump.export() without prior connect()
You must call connect() after constructor before export/import.
new RedisDump({client: existingRedisClient})
let dump = new RedisDump({client: redisClient}); // then export/import
new RedisDump({client: redisClient}); dump.connect();
If an existing client is provided, do NOT call connect() as it will try to connect again.

Shows connecting to Redis, exporting all keys in redis format, logging result.

const RedisDump = require('node-redis-dump2'); const dump = new RedisDump({ host: 'localhost', port: 6379, password: process.env.REDIS_PASSWORD || '' }); dump.connect(); dump.export({ type: 'redis', callback: function(err, data) { if (err) { console.error(err); return; } console.log(data); } });
Debug
Known issues
gotchaMust call connect() after constructor unless using existing client option.
fix
Always call dump.connect() after new RedisDump(opts) when opts does not contain 'client'.
affects: >=0.0.0
gotchaDoes not work with Redis streams (export or import).
fix
Avoid using with Redis streams; consider alternative solutions for stream data.
affects: >=0.0.0
breaking'redis' type export does not work with binary data (import/export fails).
fix
Use 'json' type for binary-safe export/import, or base64-encode binary data before export.
affects: >=0.0.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:6379
Redis server not running or wrong host/port.
fix
Ensure Redis is running and host/port are correct. Optionally use {client: existingRedisClient} to reuse an already connected client.
TypeError: dump.export is not a function
Forgot to call connect() before export, or used import/export incorrectly.
fix
Call dump.connect() first. Example: const dump = new RedisDump(opts); dump.connect(); dump.export(...);
Error: The 'redis' type does not support binary data
Using 'redis' export type with binary data (e.g., Buffer values).
fix
Switch to 'json' type or encode binary data as string (base64).
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies
ioredisoptionalUsed to create Redis client; either provided externally or initialized internally
Agent activity
5 hits · last 30 days
node
4
Resources
node-redis-dump2 — npm install node-redis-dump2 · libregistry