Minimalistic FIFO (First-In-First-Out) in-memory cache for Node.js, v1.0.1 (last released 2015; no updates since). Provides simple put and get operations with automatic eviction of oldest items when the cache reaches a user-defined maximum size. No dependencies, no TypeScript types, relies on CommonJS. Unlike more feature-rich caches (e.g., node-cache, lru-cache), this is a single-purpose FIFO cache with no TTL, no events, and no serialization.
npm install tiny-fifo-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic put/get and FIFO eviction when exceeding the maximum size of 3 items.
If reorder-on-access needed, use an LRU cache (e.g., lru-cache).
Use strings or numbers as keys for predictable behavior.
Consider migrating to actively maintained alternatives (e.g., tiny-lru, node-cache).
Write a declaration file: declare module 'tiny-fifo-cache' { export default class FIFOCache { constructor(max: number); put(key: any, value: any): void; get(key: any): any; } }Use default import: import FIFOCache from 'tiny-fifo-cache' or CommonJS require.
Use new FIFOCache(100).
No dependency data recorded yet.