A random-eviction cache library for Node.js that imposes a global size limit across all derived sub-caches. v1.0.0 is stable, with constant-time get, set, delete, and eviction. Unlike typical per-cache limit caches, Rache shares a memory budget among multiple caches via a simple global counter, making it ideal for scenarios with many small caches. No external dependencies, no runtime dependencies. Uses CommonJS, no TypeScript types provided.
npm install racheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a global-limited cache, adds entries, observes eviction, deletes, iterates keys, clears, and destroys a sub-cache.
Design systems to expect entries from any sub-cache may be evicted when total entries exceed maxSize.
If you need TTL or LRU, consider another library (e.g., lru-cache).
Always call subCache.destroy() when you're done using a sub-cache.
Use iterator methods directly (for...of) or spread into array only for small caches.
Use const Rache = require('rache') (CommonJS only).Use new Rache({ maxSize: 100 }) with a positive integer.Do not call methods on a cache after destroy(). Call .destroy() only when done.
No dependency data recorded yet.