An in-memory Redis-compatible mock implementation in pure JavaScript, ideal for testing Redis-dependent code without a real server. Version 0.1.2 (stable, low release cadence) supports core Redis commands (SET, GET, DEL, pub/sub, createClient) with blocking, callback, async, and promise styles. Unlike other mocks, it runs entirely in-memory and can be used in both Node.js and browser environments. No network overhead, no external dependencies.
npm install redis-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic synchronous usage: SET, GET, and DEL commands with an in-memory mock.
Use callbacks or promises only for consistency; actual I/O is never asynchronous.
Do not expect real Redis async behavior; this is a mock for basic testing.
Passing port, host, or options will have no effect.
Consider using ioredis-mock or redis-mock for more complete coverage.
var client = require('redis-js').createClient();Use <script src='redis-mock.min.js'> and then window.redismock
var redis = require('redis-js'); var client = redis.createClient(); client.get('key');No dependency data recorded yet.