A persistent cache library combining SQLite storage with LRU eviction and TTL expiration for Node.js and browsers (via SQL.js). The current stable version is 1.2.2, with irregular releases. Key differentiators: dual LRU+TTL eviction policy, ACID-backed persistence via SQLite, and support for both synchronous and asynchronous APIs. Unlike in-memory caches (e.g., lru-cache), data survives restarts; unlike pure SQLite caches, bounded memory is guaranteed via LRU. ESM-only, TypeScript types built-in.
npm install cache-sqlite-lru-ttlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a persistent LRU+TTL cache backed by SQLite, set and get a value, then clean up.
Replace `maxEntries` with `maxSize` (same meaning).
Always await `cache.init()` after construction.
Use `cache.close()` instead of `cache.destroy()`.
Use milliseconds: e.g., ttl: 60000 for 1 minute.
Ensure `sql-wasm.wasm` is accessible or configure via `sqlWasmPath` option.
Change to `import Cache from 'cache-sqlite-lru-ttl'` and ensure project 'type': 'module' or use .mjs extension.
Add `await cache.init()` after creating the cache instance.
On browser, ensure sql-wasm.wasm is served; on Node, delete the db file and recreate.
Provide ttl as a non-negative integer (milliseconds), e.g., ttl: 60000.
No dependency data recorded yet.