A lightweight in-memory cache for Bun using SQLite, supporting LRU eviction and TTL. Version 1.2.0 provides a Bun-specific port of sqlite-lru-cache with synchronous Gzip compression. Designed for high-performance caching in serverless or CLI environments. Active maintenance, type-safe with TypeScript definitions.
npm install bun-sqlite-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic CRUD operations, TTL expiry, compression, and persistent storage configuration.
Use only in Bun runtime.
Ensure stored values are JSON-serializable or compatible with v8 serialization.
Use compression only for values where the CPU cost is acceptable.
Use options.defaultTtlMs (only one 't' in 'default').
Check for undefined before accessing value.meta.
Use dynamic import: const { BunSQLiteCache } = await import('bun-sqlite-cache');Run with 'bun run' instead of 'node' or 'deno'.
Ensure value is serializable, e.g., use JSON.stringify manually or avoid storing functions.