Package for caching mutable resources into a content-addressable store using LevelDB. Version 1.3.3 is stable but appears unmaintained (last update years ago). It combines a content-addressable store (CAS) with a LevelDB-backed caching layer, allowing efficient retrieval and storage of resources keyed by content hash. Supports customizable getter functions for fetching resources. Different from simple LevelDB caches by leveraging CAS for deduplication and integrity. Lightweight and suitable for Node.js applications needing persistent, content-addressed caching.
npm install level-content-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a content cache with LevelDB, a content-addressable store, and a getter that fetches URLs via request.
Wrap error responses in `new Error()` before calling cb.
Replace `request` with a modern HTTP client like `node-fetch` or `axios` in custom getter.
Treat meta as read-only or clone before modification.
Always convert keys to strings before calling get.
Run `npm install level-content-cache` and use `require('level-content-cache')`.Ensure you call `ContentCache(db, cas, opts)` and assign the result to a variable.
Provide a `getter` function with signature `function(key, meta, cb)`.