A minimal utility for caching synchronous function return values with optional TTL. Current stable version is 1.1.1. It has no dependencies and ships TypeScript declarations. Differentiates by extreme simplicity (single function, no complex keying or async support) vs. heavier memoization libraries like lodash.memoize or memoizee. Suitable for one-time or stale-while-revalidate caching patterns.
npm install cache-funcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a cached version of a synchronous function with a 1-minute TTL.
Use a more feature-rich library like memoizee if you need per-argument caching.
Always use milliseconds: e.g., 5000 for 5 seconds, 60000 for 1 minute.
Wrap the async function manually or use a library that supports async caching.
Use import { cacheFunc } from 'cache-func' instead of import cacheFunc from 'cache-func'.Run npm install cache-func and ensure the import statement is correct.
No dependency data recorded yet.