{"id":46370,"library":"simple-cluster-cache","title":"simple-cluster-cache","description":"simple-cluster-cache is a dead-simple in-memory cache for Node.js cluster applications, enabling shared caching between master and worker processes via IPC. Version 0.0.6 is the latest release. It provides basic get/set/del/clear methods with optional TTL and callback support, and supports both single-key and multi-key operations. It is designed specifically for the Node.js cluster module and does not require external dependencies like Redis or Memcached. The package has not seen updates since its initial release and has limited adoption.","status":"maintenance","version":"0.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/rfrench/simple-cluster-cache","tags":["javascript","cache","cluster","worker","master"],"install":[{"cmd":"npm install simple-cluster-cache","lang":"bash","label":"npm"},{"cmd":"yarn add simple-cluster-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add simple-cluster-cache","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import is available; the package also supports CommonJS require.","wrong":"const cache = require('simple-cluster-cache');","symbol":"default (cache object)","correct":"import cache from 'simple-cluster-cache';"},{"note":"Callback is optional for get, but without it the value is not returned; use callback to retrieve the value.","wrong":"cache.get('key');","symbol":"cache.get","correct":"cache.get('key', callback);"},{"note":"TTL and callback are optional; if omitted, the cache entry lives indefinitely and no callback is called.","wrong":"cache.set('key', value);","symbol":"cache.set","correct":"cache.set('key', value, ttl, callback);"}],"quickstart":{"code":"import cluster from 'cluster';\nimport cache from 'simple-cluster-cache';\n\nif (cluster.isMaster) {\n  cache.set('msg', 'Hello from master');\n  cluster.fork();\n} else {\n  cache.get('msg', (err, value) => {\n    console.log(value); // 'Hello from master'\n  });\n}","lang":"javascript","description":"Sets a cache entry in the master process and retrieves it in a worker process, demonstrating shared cache across cluster."},"warnings":[{"fix":"Always provide a callback to retrieve the cached value. cache.get('key', (err, val) => { console.log(val); });","message":"get method call without a callback does not return the value synchronously.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using a maintained alternative like node-cache-manager or built-in cluster IPC.","message":"The package has no recent updates and may not work with newer Node.js versions (e.g., ESM support, cluster module changes).","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Handle the result as an object: cache.get(['key1', 'key2'], (err, result) => { console.log(result.key1); });","message":"When using multi get, the returned value is an object mapping keys to values, not an array.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.0.6':33 'adopt':92 'applic':21 'basic':40 'cach':4,8,17,24,94 'callback':47 'cluster':3,7,20,67,95 'dead':12 'dead-simpl':11 'depend':74 'design':62 'enabl':22 'extern':73 'get/set/del/clear':41 'in-memori':14 'initi':87 'ipc':31 'javascript':93 'key':54,58 'latest':36 'like':75 'limit':91 'master':26,97 'memcach':78 'memori':16 'method':42 'modul':68 'multi':57 'multi-key':56 'node.js':19,66 'oper':59 'option':44 'packag':80 'process':29 'provid':39 'redi':76 'releas':37,88 'requir':72 'seen':83 'share':23 'simpl':2,6,13 'simple-cluster-cach':1,5 'sinc':85 'singl':53 'single-key':52 'specif':63 'support':48,50 'ttl':45 'updat':84 'version':32 'via':30 'worker':28,96","created_at":"2026-06-07T12:59:35.500464+00:00","updated_at":"2026-06-07T12:59:35.500464+00:00","problems":[{"fix":"Use default import: import cache from 'simple-cluster-cache';","cause":"Using import incorrectly, e.g., importing named exports instead of default export.","error":"Error: cache.get is not a function"},{"fix":"Provide a callback function as the last argument: cache.get('key', (err, val) => {});","cause":"Calling get/set without a callback but expecting the value returned.","error":"TypeError: callback is not a function"}],"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/rfrench/simple-cluster-cache","github":"https://github.com/rfrench/simple-cluster-cache","docs":null,"changelog":null,"pypi":null,"npm":"simple-cluster-cache","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"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}}