Registry / database / memcache-plus

memcache-plus

JSON →
library0.3.1jsnpmunverified

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).

npm install memcache-plus
INSTALL
IMPORT
SIG · MEMCACHE-PLUS
M
memcache-plus
databasejavascriptv0.3.1
harness data pending
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.

MemcachePlus
import MemcachePlus from 'memcache-plus'
import { MemcachePlus } from 'memcache-plus'
Default import. The package is a CommonJS module, but ESM import works with bundlers. No named export.
Client constructor
const MemcachePlus = require('memcache-plus'); const client = new MemcachePlus(hosts);
const client = new require('memcache-plus')(hosts);
CommonJS usage: require returns the constructor directly.
MemoryStore
import MemcachePlus from 'memcache-plus'
import MemoryStore from 'memcache-plus'
There is no separate MemoryStore export; the package only exports the main client class.

Shows how to create a client, connect, set/get/delete values, and disconnect.

const MemcachePlus = require('memcache-plus'); async function main() { const client = new MemcachePlus(['127.0.0.1:11211']); // Wait for connection await client.connect(); // Set a value await client.set('key', 'value', 3600); // Get a value const val = await client.get('key'); console.log(val); // 'value' // Delete await client.delete('key'); // Disconnect client.disconnect(); } main().catch(console.error);
Debug
Known issues
breakingThe connect() method must be awaited; otherwise commands may fail silently.
fix
Always await client.connect() before issuing commands.
affects: >=0.1.0
deprecatedCallback-based API is deprecated in favor of Promises.
fix
Use async/await or .then() instead of callbacks.
affects: >=0.3.0
gotchaThe set() method expects a TTL in seconds (not milliseconds) – common mistake.
fix
Pass TTL in seconds, e.g., 3600 for 1 hour.
affects: >=0.1.0
gotchaElasticache auto-discovery expects a configuration endpoint, not a node list.
fix
For Elasticache, pass the configuration endpoint URL as the host string.
affects: >=0.2.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:11211
Memcached server is not running or port is wrong.
fix
Start memcached: memcached -d start or check the host/port.
TypeError: client.get is not a function
Using the client before calling connect() or mixing import styles.
fix
Await client.connect() first, or use the ESM import: import MemcachePlus from 'memcache-plus'.
Cannot find module 'memcache-plus'
Package not installed or incorrectly installed.
fix
Run: npm install memcache-plus
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
memcache-plus — npm install memcache-plus · libregistry