nx-cache is a minimal in-memory cache SDK for Node.js (v1.0.2, stable) that requires zero configuration and supports TTL, scoped keys, and user-defined metadata. Unlike full-featured caching solutions (node-cache, lru-cache), nx-cache emphasizes simplicity: no setup, no config, and a focused API for write, read, search, and reset operations. It ships TypeScript types and is per-process memory only, with planned future backends (Redis, disk).
npm install nx-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a cache instance, writes a scoped entry, reads it back, and then resets the key.
Always pass a scope object (or null) matching the write call.
To set custom TTL, look for future API additions; in v1, manage TTL manually or use another library.
Use ESM imports (import { createNxCache } from 'nx-cache') instead of require().Apply additional filtering on the returned array if needed.
Use with caution; consider resetKey() for targeted removal.
Change `const { createNxCache } = require('nx-cache')` to `import { createNxCache } from 'nx-cache'`Ensure you use `import { createNxCache } from 'nx-cache'` and have TypeScript's esModuleInterop enabled if needed.Verify that the scope object passed to read() exactly matches the one used in write(), including key order is irrelevant but same properties.
Run `npm install nx-cache` and check that the import path is exactly `'nx-cache'`.
Pass null explicitly if no scope: `cache.write('key', value, { scope: null })`No dependency data recorded yet.