Registry / storage / node-cache-manager

node-cache-manager

JSON →
library1.2.0jsnpmunverified

A simple in-memory cache manager for Node.js applications, version 1.2.0. It provides basic caching functionality with TTL support, suitable for small projects or simple caching needs. However, note that the package is outdated (last release from 2018) and has not been maintained, with no support for advanced features like clustering, persistence, or multi-tier caching that modern alternatives like keyv or node-cache offer. The package uses a singleton pattern and is not recommended for new projects.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The package is CommonJS-only; using import may require a bundler. The example shows require.

import cacheManager from 'node-cache-manager'

TypeScript users may want the named export, but the package does not ship TypeScript definitions.

const { CacheManager } = require('node-cache-manager')

The module exports a singleton instance with methods get, set, del, clear.

const cache = require('node-cache-manager'); cache.get('key')

Demonstrates basic set, get, del, and clear operations with TTL.

const cache = require('node-cache-manager'); // Set a value with TTL in seconds cache.set('myKey', { data: 'hello' }, 60); // expires in 60 seconds // Get a value const value = cache.get('myKey'); if (value) { console.log(value.data); // 'hello' } else { console.log('Key not found or expired'); } // Delete a key cache.del('myKey'); // Clear all cache cache.clear(); console.log('Cache operations complete');
Debug
Known footguns
deprecatedPackage is no longer maintained. No updates since 2018.
gotchaThe cache is a global singleton; multiple requires share the same store.
gotchaTTL is in seconds, not milliseconds.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources