
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
@sebspark/memredis
Advanced tools
An in-memory implementation of Redis. Fully compatible with the Redis client API for development, testing, and scenarios where an in-memory store suffices.
@sebspark/memredisAn in-memory implementation of Redis. Fully compatible with the Redis client API for development, testing, and scenarios where an in-memory store suffices.
yarn add @sebspark/memredis
import { MemRedis } from '@sebspark/memredis'
const client = new MemRedis()
// Set and get
await client.set('key', 'value')
const value = await client.get('key') // 'value'
// Expiration
await client.setEx('temp-key', 60, 'expires in 60 seconds')
const ttl = await client.ttl('temp-key') // ~60
// Delete
await client.del('key')
const client = new MemRedis()
await client.hSet('user:1', { name: 'Alice', age: '30' })
const user = await client.hGetAll('user:1') // { name: 'Alice', age: '30' }
await client.hDel('user:1', 'age')
const client = new MemRedis()
// Lists
await client.lPush('queue', ['job1', 'job2'])
const job = await client.lPop('queue') // 'job2'
// Sets
await client.sAdd('tags', ['a', 'b', 'c'])
const members = await client.sMembers('tags') // ['a', 'b', 'c']
// Sorted sets
await client.zAdd('leaderboard', { score: 100, value: 'alice' })
const top = await client.zRangeWithScores('leaderboard', 0, 0, { REV: true })
All MemRedis instances share the same pub/sub bus, matching real Redis behaviour where all clients connect to the same server.
If you type against IPersistor, pub/sub subscription methods use transport-specific return values. MemRedis returns subscription counts, while redis clients resolve those methods without a value.
import { MemRedis } from '@sebspark/memredis'
const publisher = new MemRedis()
const subscriber = new MemRedis()
await subscriber.subscribe('events', (message) => {
console.log('Received:', message)
})
await publisher.publish('events', 'hello world')
Use MemRedis in tests to avoid Docker overhead while still maintaining Redis-compatible behavior. The e2e test suite verifies MemRedis behavior matches actual Redis exactly.
import { describe, it, expect } from 'vitest'
import { MemRedis } from '@sebspark/memredis'
describe('my cache', () => {
it('stores and retrieves values', async () => {
const cache = new MemRedis()
await cache.set('key', 'value')
expect(await cache.get('key')).toBe('value')
})
})
For production use cases requiring Redis features, use the official redis package.
FAQs
An in-memory implementation of Redis. Fully compatible with the Redis client API for development, testing, and scenarios where an in-memory store suffices.
We found that @sebspark/memredis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.