A Redis client for Cloudflare Workers using cloudflare:sockets. Current version: 0.4.2. Actively maintained with fast release cadence. Key differentiator: works natively in Cloudflare Workers environment without polyfills, supports TLS, raw Uint8Array commands, and can also run in Node.js with @arrowood.dev/socket. Minimal and lightweight compared to ioredis.
npm install redis-on-workersNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to Redis and performs a simple SET/GET, then closes the connection.
Use 'await redis.connection()' immediately after createRedis if you need to ensure the connection is available.
Use sendRaw for raw bytes; use sendOnceRaw for a one-off command returning Uint8Array.
Replace 'import createRedis from "redis-on-workers"' with 'import { createRedis } from "redis-on-workers"'.Set tls: true in options or use 'rediss://' URL to enable TLS automatically.
Add `"type": "module"` to your package.json or use dynamic import() if stuck with CommonJS.
Use `import { createRedis } from 'redis-on-workers'` instead of `import createRedis from 'redis-on-workers'`.Ensure Redis is running and verify the URL string passed to createRedis.
Include username:password in the Redis URL, e.g., `redis://user:pass@host:port`.