blru is a lightweight LRU cache library for Node.js, version 0.1.8. It provides a simple and efficient implementation of a Least Recently Used cache. The library is designed for Node.js environments (>=8.0.0) and is commonly used as a dependency in the bcoin ecosystem. It offers basic operations like get, set, del, and has, with configurable maximum size. Compared to other caching libraries like lru-cache, blru focuses on minimalism and stability, though it has limited recent maintenance.
npm install blruNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating an LRU cache with max size, basic operations (set, get, has, del), and iteration over entries.
Always pass a positive integer to the constructor (e.g., new blru(100)).
Use a standard for...of loop; be aware that the order differs from Map.
Use require('blru') or wrap in a CommonJS module.Install @types/blru if available, or create a declaration file.
Use new blru(max) instead of blru(max).
Run npm install blru and ensure require('blru') is correct.Switch to const blru = require('blru'); or enable ESM in your project.No dependency data recorded yet.