@mysetup/cache
v2.0.10
Published
Shared in-memory cache helpers built on top of node-cache.
Downloads
692
Maintainers
Readme
@mysetup/cache
Thin wrapper around node-cache for in-memory key/value storage.
Installation
pnpm add @mysetup/cacheSupported libraries and runtimes
| Supported | Notes | | ---------------------- | ------------------------------------------------------ | | Node.js | Full support | | Next.js server runtime | Use in route handlers, server actions, or backend code | | Vite browser apps | Not supported |
Usage
import { setCacheData, getCacheData, deleteCacheData } from "@mysetup/cache";
setCacheData("session:user:1", { id: 1 }, 60);
const session = getCacheData("session:user:1");
deleteCacheData("session:user:1");Notes
- Cache data is stored in process memory.
- Do not rely on this package for distributed caching across multiple servers.
