Cache handler for clay-resources, part of the ClayDB ecosystem. Provides an LRU cache with configurable max size and TTL for caching clay-entity objects. Version 2.0.3 is the current stable release; the package is in maintenance mode with no recent updates. It wraps the popular lru-cache library internally and exposes a simple API: create cache with options, store an entity with a unique ID, and retrieve by ID. Unlike generic caching solutions, it integrates seamlessly with clay-entity and clay-resource patterns, but its utility is limited to that ecosystem. The package requires Node >=8 and has no runtime dependencies beyond clay-entity and lru-cache.
npm install clay-resource-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a resource cache with max 1000 items and 1-hour TTL, stores and retrieves a clay-entity.
Consider using a general-purpose caching library like lru-cache directly or migrate to a more actively maintained ClayDB component.
Use clayResourceCache(options) instead of new clayResourceCache(options).
Always wrap data in clayEntity({...}) before storing, or ensure objects have an 'id' property.Pin Node.js to version 12 or 14, or override lru-cache version in package.json resolutions if possible.
Consider using an async-capable caching library if concurrency is needed.
Remove 'new': const cache = clayResourceCache(options) instead of const cache = new clayResourceCache(options).
Run: npm install clay-entity
Ensure you pass a valid clay-entity object to cache.store(), and that all entities have an 'id' property.