{"id":45562,"library":"node-cache-manager","title":"node-cache-manager","description":"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.","status":"deprecated","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/ProdioDesignWorks/cache","tags":["javascript"],"install":[{"cmd":"npm install node-cache-manager","lang":"bash","label":"npm"},{"cmd":"yarn add node-cache-manager","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-cache-manager","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is CommonJS-only; using import may require a bundler. The example shows require.","wrong":"const cacheManager = require('node-cache-manager')","symbol":"default","correct":"import cacheManager from 'node-cache-manager'"},{"note":"TypeScript users may want the named export, but the package does not ship TypeScript definitions.","wrong":"","symbol":"CacheManager","correct":"const { CacheManager } = require('node-cache-manager')"},{"note":"The module exports a singleton instance with methods get, set, del, clear.","wrong":"","symbol":"get","correct":"const cache = require('node-cache-manager'); cache.get('key')"}],"quickstart":{"code":"const cache = require('node-cache-manager');\n\n// Set a value with TTL in seconds\ncache.set('myKey', { data: 'hello' }, 60); // expires in 60 seconds\n\n// Get a value\nconst value = cache.get('myKey');\nif (value) {\n  console.log(value.data); // 'hello'\n} else {\n  console.log('Key not found or expired');\n}\n\n// Delete a key\ncache.del('myKey');\n\n// Clear all cache\ncache.clear();\n\nconsole.log('Cache operations complete');","lang":"javascript","description":"Demonstrates basic set, get, del, and clear operations with TTL."},"warnings":[{"fix":"Use a maintained alternative like keyv or node-cache.","message":"Package is no longer maintained. No updates since 2018.","severity":"deprecated","affected_versions":"*"},{"fix":"Be aware that clearing the cache in one module affects all others.","message":"The cache is a global singleton; multiple requires share the same store.","severity":"gotcha","affected_versions":"*"},{"fix":"Convert your TTL: e.g., 5 minutes = 300 seconds.","message":"TTL is in seconds, not milliseconds.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'1.2.0':16 '2018':43 'advanc':53 'altern':65 'applic':14 'basic':19 'cach':3,10,20,31,62,71 'cluster':56 'featur':54 'function':21 'howev':33 'in-memori':7 'javascript':86 'keyv':67 'last':40 'like':55,66 'maintain':48 'manag':4,11 'memori':9 'modern':64 'multi':60 'multi-ti':59 'need':32 'new':84 'node':2,70 'node-cach':69 'node-cache-manag':1 'node.js':13 'note':34 'offer':72 'outdat':39 'packag':37,74 'pattern':78 'persist':57 'project':28,85 'provid':18 'recommend':82 'releas':41 'simpl':6,30 'singleton':77 'small':27 'suitabl':25 'support':24,51 'tier':61 'ttl':23 'use':75 'version':15","created_at":"2026-06-07T12:55:37.288671+00:00","updated_at":"2026-06-07T12:55:37.288671+00:00","problems":[{"fix":"Use require('node-cache-manager') instead of import.","cause":"Likely using ES import syntax with a CommonJS-only module.","error":"TypeError: cache.set is not a function"},{"fix":"Run 'npm install node-cache-manager' and ensure package.json contains it.","cause":"Package not installed or name mistyped.","error":"Module not found: Can't resolve 'node-cache-manager'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/ProdioDesignWorks/cache#readme","github":"https://github.com/ProdioDesignWorks/cache","docs":null,"changelog":null,"pypi":null,"npm":"node-cache-manager","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}