In-memory LRU cache for abstract-chunk-store compliant stores. Version 3.2.2 is the latest stable release, with a maintenance status and low release cadence. It wraps any abstract-chunk-store implementation (e.g., fs-chunk-store) to cache get() results using the lru package, reducing repeated I/O. Differentiators: minimal API, transparent caching, passes through options to lru (e.g., max size). Commonly used in BitTorrent clients and other peer-to-peer applications.
npm install cache-chunk-storeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a cached chunk store using fs-chunk-store with LRU max 100, puts a chunk, and retrieves it twice (second is cached).
Ensure the inner store implements all required methods (put, get, close, destroy).
Consider using an alternative like lru-cache or wrapping manually.
Upgrade to 3.x and swap arguments: new CacheChunkStore(store, opts).
Use Uint8Array or polyfill Buffer; or use a version that imports Buffer.
Ensure the store implements get, put, close, and destroy methods.
Use Buffer.from() to pass buffers.