Cacheable

High-performance layer 1 / layer 2 caching engine built on Keyv

Library
npm
v2.5.0
2,007stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity92
Maintenance84
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture80
Code Quality82
Innovation75
Learning Curve78

Cacheable is a distributed caching library for Node.js built on top of the Keyv storage engine, providing simple layered (memory + remote) caching with an enterprise-grade feature set. It combines an in-memory LRU cache (CacheableMemory) as a fast primary layer with any Keyv-compatible secondary store (Redis, etc.), non-blocking writes, and a CacheSync pub/sub mechanism for keeping multiple instances consistent.

Part of the broader jaredwray/cacheable monorepo (which also ships cache-manager, cacheable-request, flat-cache, and other caching utilities), Cacheable is under active, regular maintenance with comprehensive test coverage and both ESM and CommonJS builds.

What You Get

  • Cacheable class combining a fast in-memory primary store with an optional remote secondary store
  • CacheableMemory - a standalone LRU cache with TTL/expiration support
  • Function memoization via wrap() and getOrSet() with stampede protection for sync and async functions
  • Hooks and events (before/after set, get, delete) to extend caching behavior
  • CacheSync for distributed cache invalidation across instances via pub/sub
  • Non-blocking secondary-store writes so remote latency doesn’t block reads/writes

Common Use Cases

  • Adding a fast in-memory layer in front of Redis to cut round-trips for hot keys
  • Memoizing expensive async function calls (e.g. DB queries) with automatic TTL
  • Keeping cache state consistent across multiple app instances via CacheSync
  • Tag-based invalidation of related cache entries after a data update
  • Building a resilient caching layer that degrades gracefully if the remote store is offline

Under The Hood

Architecture - The packages/cacheable module (within the jaredwray/cacheable pnpm monorepo) centers on a Cacheable class in src/index.ts that composes a primary Keyv instance (defaulting to CacheableMemory, an in-memory LRU store defined in src/memory.ts equivalents) with an optional secondary Keyv-compatible store; reads check primary then fall back to secondary, writes propagate to both non-blockingly, and sync.ts implements CacheSync, a pub/sub layer that broadcasts invalidations to keep multiple processes’ primary caches consistent.

Tech Stack - Written in TypeScript (97%+ of the monorepo), built with tsdown to emit both ESM (.mjs) and CommonJS (.cjs) outputs with generated .d.ts types, and depends on the keyv storage-adapter ecosystem (@keyv/redis, lru-cache) rather than hardcoding a specific backend, using pnpm workspaces to share tooling (biome for linting) across the monorepo’s ten-plus packages.

Code Quality - The monorepo enforces test coverage via Codecov badges and a GitHub Actions tests.yml workflow; the cacheable package itself is a relatively small, focused module (~2,200 lines across src/), and the monorepo’s shared CONTRIBUTING.md/AGENTS.md/CLAUDE.md files indicate deliberate conventions for contributors and AI coding agents alike.

API Design - The API is intentionally minimal - new Cacheable({secondary}) plus .get()/.set()/.delete() covers the common case, with TTL shorthand strings ('1h', '1d') reducing boilerplate, and wrap()/getOrSet() let existing functions be memoized without restructuring calling code; hooks and typed events provide an escape hatch for advanced use without complicating the base API.

Used by 15 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,588

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
74
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated yesterday
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,884

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
91
Repo Health
77
Technical
61
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
95%
AGPL 3.0

Docmost

Productivity · Note Taking · Collaboration

21,600

Self-hosted collaborative wiki and knowledge base with real-time editing, diagrams, AI assistance, and enterprise access controls — a modern alternative to Confluence and Notion.

View details
89
Repo Health
70
Technical
70
Dependency
Built with
TypeScript95%
Updated yesterday
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,427

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
86
Repo Health
77
Technical
63
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 3 weeks ago
JavaScript
47%
MIT

Ghost

CMS · Blogging

55,191

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
JavaScript47%
TypeScript47%
Updated yesterday
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,213

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
77
Repo Health
76
Technical
65
Dependency
Built with
TypeScript98%
Updated 2 weeks ago
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,213

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
77
Repo Health
76
Technical
65
Dependency
Built with
TypeScript98%
Updated 2 weeks ago
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,372

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 2 weeks ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search