An in-memory cache for Node and the browser designed for Promises. Current stable version is 3.0.2. Released as a lightweight (under 1KB) alternative to libraries like lru-cache, with built-in support for caching async operations (e.g., fetch) and automatic cleanup of expired items. It accepts human-readable expiry strings via the 'ms' package. Ships TypeScript definitions.
npm install keshiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a Keshi cache, resolve with a Promise and expiry, delete, clear, and teardown.
Ensure you use import Keshi from 'keshi' or const Keshi = require('keshi'). Do not destructure.Replace cache.del(key) with cache.delete(key).
Always use await cache.resolve(...) or .then().
Consider prefixing keys with a namespace and validating key strings.
Use import Keshi from 'keshi' instead of import { Keshi } from 'keshi'.Ensure getValue returns a value or Promise.