cached-iterable provides CachedSyncIterable and CachedAsyncIterable classes that wrap any iterable to cache yielded elements, enabling multiple iterations without depletion. Stable version 0.3.0, low release cadence (last release Feb 2019). Key differentiator: simple, lightweight caching for both sync and async iterables, with no dependencies and support for legacy browsers via a compat build. Suitable for client-side and server-side use.
npm install cached-iterableNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates wrapping sync and async iterables with CachedSyncIterable and CachedAsyncIterable to allow multiple iterations.
Ensure first iteration completes before expecting cache to be populated for concurrent consumers.
Consider forking or using alternative libraries if compatibility with modern environments is needed.
Use import { CachedSyncIterable } from 'cached-iterable'Ensure compat build is present or use main entry for modern environments.
No dependency data recorded yet.