A tiny (215B) and fast Least Recently Used (LRU) cache for JavaScript. Stable version 1.0.2, last updated in 2019. No active release cadence; essentially stable and minimal. Key differentiators: extremely small size (215B), high performance with a two-cache internal architecture that trades memory for speed, supports ESM, CJS, and UMD formats, and includes TypeScript types. Compared to alternatives like lru-cache or tiny-lru, flru is much smaller and faster for typical operations but uses 2n memory and has a simpler API.
npm install flruNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an LRU cache with max 3 items, demonstrates set, get, has, eviction, and clear.
Consider memory implications when using with large limits.
Read the documentation on the two-cache architecture to understand eviction behavior.
Always pass a positive integer to flru().
Evaluate lru-cache or tiny-lru for active maintenance.
Use import flru from 'flru'
Use const flru = require('flru')Call flru with a max number: const cache = flru(3)
No dependency data recorded yet.