{"library":"cache-lru","type":"library","category":null,"description":"Cache-LRU is a minimal JavaScript library that provides an in-memory key-indexed cache with Least-Recently-Used (LRU) purging strategy. Current stable version is 1.2.0, released on 2025-01-27. Unlike many LRU caches (e.g., lru-cache, node-lru-cache), Cache-LRU guarantees strict O(1) time complexity for all main operations (get, set, has, del, touch, peek) including internal LRU reordering, making it suitable for performance-critical applications. It supports optional per-item expiration and a disposal callback. The library is small (≈300 lines), has zero dependencies, and works in both Node.js and browser environments. It exports a single class via CommonJS. No TypeScript types are bundled.","language":"javascript","status":"active","version":"1.2.0","tags":["javascript","cache","lru"],"last_verified":"Sun Jun 07","install":[{"cmd":"npm install cache-lru","imports":["const CacheLRU = require('cache-lru');","import CacheLRU from 'cache-lru';","// @ts-ignore\nconst CacheLRU = require('cache-lru');"]},{"cmd":"yarn add cache-lru","imports":[]},{"cmd":"pnpm add cache-lru","imports":[]}],"homepage":"https://github.com/rse/cache-lru","github":"https://github.com/rse/cache-lru","docs":null,"changelog":null,"pypi":null,"npm":"cache-lru","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}