FIG-001 · MASTHEAD

Memory Cache - a lightweight TypeScript in-memory caching library

Zero-dependency caching for TypeScript. In-memory MemoryCache storage with TTL expiration, LRU eviction, wildcard pattern deletion, and a powerful @cached decorator for method-level memoization. Built for API responses, sessions, computed values, and fast local data reuse.

get started ↗ api reference examples
FIG-001
SHEET 01 / 03
exports
3
MemoryCache · cached · types
policies
2
TTL · LRU eviction
hooks
6
hit · miss · set · evict · expire · delete
tarball
26.6kB
packed (npm gz)
runtime deps
0
zero-dependency runtime
licence
MIT
on GitHub
FIG-002 / CACHE

cache with live telemetry.

Drive a bounded MemoryCache and watch hits, misses, LRU order, and eviction pressure update against the same in-memory store.

file · cache.ts hit 100% size 4/6 last seed ○ READY
operation seed

last key · session

result warm
rank
key
value
state
01
user:1 Ada
LRU
02
user:2 Grace
warm
03
config prod
warm
04
session warm
MRU
05
empty slot
open
06
empty slot
open
FIG-003 / WHY US

why memory cache.

Simple, fast, and reliable caching for your TypeScript applications.

№ 01 / 06

Lightning Fast

In-memory storage with O(1) lookups. No network latency, no disk I/O — just pure speed.

№ 02 / 06

TTL Expiration

Set time-to-live for cache entries. Expired items are automatically cleaned up when they age out.

№ 03 / 06

LRU Eviction

Smart eviction policy removes least recently used items when the cache reaches max size.

№ 04 / 06

@cached Decorator

Automatic method-level caching with a simple decorator. No boilerplate required.

№ 05 / 06

TypeScript First

Full type safety with generics. Cached values stay properly typed from write to read.

№ 06 / 06

Zero Dependencies

Lightweight and self-contained. No bloat, no runtime dependency chain to audit.

FIG-004 / AI-READY

built for llm-assisted code.

Point Cursor, Claude Code, or any LLM at the manifests below and they know the Memory Cache API — constructor options, TTL behavior, LRU semantics, decorators, and examples.

SET / JETBRAINS MONO + INTER
HUMANSPEAK · 2026
MIT LICENCE
● 1.1.1
SHEET 04 / 04
END OF DOCUMENT
↩ TO TOP