co-cache

JSON →
library 4.1.0 ·javascript
verified Jun 7, 2026

A middleware-like caching library for async functions (including AsyncFunction and Promise-based) that caches results in Redis using ioredis. Version 4.1.0 is stable, with regular updates. It wraps any async function, caching its return value based on a configurable key (defaults to function name) and TTL. Supports custom get/set logic, conditional caching, manual cache management (get, set, clear, raw), and automatic serialization via JSON. Differentiators: simple API, first-class ioredis support, and fine-grained cache control per function invocation.