{"id":25930,"library":"memcache-plus","title":"Memcache Plus","description":"memcache-plus is a Node.js memcache client with native Promise support, Elasticache auto-discovery, command buffering, and built-in compression. Current stable version is 0.3.1. Released irregularly. It differentiates from other memcache clients (like memcached) by providing a clean Promise-based API, automatic Elasticache cluster detection, and a flag to disable caching for testing. Supports both callbacks and Promises, and allows starting commands before connection (buffering).","status":"active","version":"0.3.1","language":"javascript","source_language":"en","source_url":"git://github.com/victorquinn/memcache-plus","tags":["javascript","memcache","memcached","cache","promise","elasticache","cluster"],"install":[{"cmd":"npm install memcache-plus","lang":"bash","label":"npm"},{"cmd":"yarn add memcache-plus","lang":"bash","label":"yarn"},{"cmd":"pnpm add memcache-plus","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import. The package is a CommonJS module, but ESM import works with bundlers. No named export.","wrong":"import { MemcachePlus } from 'memcache-plus'","symbol":"MemcachePlus","correct":"import MemcachePlus from 'memcache-plus'"},{"note":"CommonJS usage: require returns the constructor directly.","wrong":"const client = new require('memcache-plus')(hosts);","symbol":"Client constructor","correct":"const MemcachePlus = require('memcache-plus'); const client = new MemcachePlus(hosts);"},{"note":"There is no separate MemoryStore export; the package only exports the main client class.","wrong":"import MemoryStore from 'memcache-plus'","symbol":"MemoryStore","correct":"import MemcachePlus from 'memcache-plus'"}],"quickstart":{"code":"const MemcachePlus = require('memcache-plus');\n\nasync function main() {\n  const client = new MemcachePlus(['127.0.0.1:11211']);\n\n  // Wait for connection\n  await client.connect();\n\n  // Set a value\n  await client.set('key', 'value', 3600);\n\n  // Get a value\n  const val = await client.get('key');\n  console.log(val); // 'value'\n\n  // Delete\n  await client.delete('key');\n\n  // Disconnect\n  client.disconnect();\n}\n\nmain().catch(console.error);","lang":"javascript","description":"Shows how to create a client, connect, set/get/delete values, and disconnect."},"warnings":[{"fix":"Always await client.connect() before issuing commands.","message":"The connect() method must be awaited; otherwise commands may fail silently.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Use async/await or .then() instead of callbacks.","message":"Callback-based API is deprecated in favor of Promises.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Pass TTL in seconds, e.g., 3600 for 1 hour.","message":"The set() method expects a TTL in seconds (not milliseconds) – common mistake.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"For Elasticache, pass the configuration endpoint URL as the host string.","message":"Elasticache auto-discovery expects a configuration endpoint, not a node list.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Start memcached: memcached -d start or check the host/port.","cause":"Memcached server is not running or port is wrong.","error":"Error: connect ECONNREFUSED 127.0.0.1:11211"},{"fix":"Await client.connect() first, or use the ESM import: import MemcachePlus from 'memcache-plus'.","cause":"Using the client before calling connect() or mixing import styles.","error":"TypeError: client.get is not a function"},{"fix":"Run: npm install memcache-plus","cause":"Package not installed or incorrectly installed.","error":"Cannot find module 'memcache-plus'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}