{"_id":"memcache","_rev":"23-e6bdca7ceb23256f940a4251de701bbd","name":"memcache","dist-tags":{"latest":"1.6.0"},"versions":{"0.1.1":{"name":"memcache","version":"0.1.1","keywords":["memcache","memcached"],"author":{"name":"Tim Eggert","email":"tim@elbart.com"},"_id":"memcache@0.1.1","homepage":"https://github.com/elbart/node-memcache","dist":{"shasum":"d6a417d51becef766e89cb85fbd2701a802a63b6","tarball":"https://registry.npmjs.org/memcache/-/memcache-0.1.1.tgz","integrity":"sha512-+zSpRFmdxKkHBI4TY0CJUq+roMQ6jiMjUTOtVPbvl6C0Ni3JjUooLnoZUc9XQ1PhPMQ3J2uRR3lRme/Ycsg8xA==","signatures":[{"sig":"MEYCIQC0mkO+H7oU3VY5qiosAdQsEk+PBDWSpTWaD2vLg4DpMgIhAPnsVHGaWBmp9e8dC3KV3bZk80JylH487dZ9LU0aEkrL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/memcache","files":[""],"engines":{"node":">= 0.3"},"scripts":{"test":"make test","test-cov":"make test-cov"},"repository":"git://github.com/elbart/node-memcache.git","_npmVersion":"0.2.19","description":"simple memcache client","directories":{"lib":"lib","test":"test"},"_nodeVersion":"v0.3.8","dependencies":{"expresso":">=0.7.0"},"_defaultsLoaded":true,"_engineSupported":true},"0.2.0":{"name":"memcache","version":"0.2.0","keywords":["memcache","memcached"],"author":{"name":"Tim Eggert","email":"tim@elbart.com"},"_id":"memcache@0.2.0","homepage":"https://github.com/elbart/node-memcache","dist":{"shasum":"6e2be553f1f272295b8c8f6e0e1860887de7855e","tarball":"https://registry.npmjs.org/memcache/-/memcache-0.2.0.tgz","integrity":"sha512-fDDP18G7Hnw86Fd6gasRkRz59/dm8195HcwT9kzzFZXx4T3+jOd4FdQIJWY+nArdNvnEAwCrwfPPtPl5vWwzmg==","signatures":[{"sig":"MEQCIHVOOgxOx+bKw6FhHUF6OP+64xtxvGFyj3VUpJhfVS/rAiAx1ChRDoxesnzwopeBDnWrKUK84AiHK06xwz9t4o268Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/memcache","engines":{"node":"*"},"scripts":{"test":"make test","test-cov":"make test-cov"},"repository":{"url":"git://github.com/elbart/node-memcache.git","type":"git"},"_npmVersion":"1.0.6","description":"simple memcache client","directories":{"lib":"lib","test":"test"},"_nodeVersion":"v0.4.7","dependencies":{},"_defaultsLoaded":true,"devDependencies":{"expresso":">=0.7.0"},"_engineSupported":true},"0.3.0":{"name":"memcache","version":"0.3.0","keywords":["memcache","memcached"],"author":{"name":"Tim Eggert","email":"tim@elbart.com"},"_id":"memcache@0.3.0","maintainers":[{"name":"elbart","email":"tim@elbart.com"}],"homepage":"https://github.com/elbart/node-memcache","dist":{"shasum":"bdbb978ea4bee0fdd3166997b1883d297e0859dc","tarball":"https://registry.npmjs.org/memcache/-/memcache-0.3.0.tgz","integrity":"sha512-dGaPFzJx6wYtLlimReN12R86dRcp/JuNB4VtW2KKjNEP5Lmo/yLD3Y0ShrkqyjGvsKMs5ysRbXqQWFMPdYzrcQ==","signatures":[{"sig":"MEUCIC6Y+2Idu3ishjrOu0wnG0RvBFcHzIA0PejlS1GI8XO0AiEA4VKIAZrh2Cc4+f6zuxCs5oJ37bZoq60WOeOho42GshI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/memcache","engines":{"node":">=0.6.0"},"scripts":{"test":"make test","test-cov":"make test-cov"},"repository":{"url":"git://github.com/elbart/node-memcache.git","type":"git"},"_npmVersion":"1.0.6","description":"simple memcache client","directories":{"lib":"lib","test":"test"},"_nodeVersion":"v0.5.3","dependencies":{},"_defaultsLoaded":true,"devDependencies":{"expresso":">=0.7.0"},"_engineSupported":false},"1.0.0":{"name":"memcache","version":"1.0.0","keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"memcache@1.0.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"dist":{"shasum":"9a07f83cc744a9a7383a4e306bd729d3671894b3","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.0.0.tgz","fileCount":37,"integrity":"sha512-cskBRQ/B0lV1WewqNP4HAsKI901dpEVSA9dFuOMat77qTjiMkNenq93oVDgQYqe+MPSlVxkQRDFY1OSY/p7d6w==","signatures":[{"sig":"MEYCIQCJhy4ygw8JJTMPI5A8vbAlHedn00FAxFrPdE1XWmQzxAIhAJPWMjEUldcNnjDTu8lTz2RRorIx0RwadvON9TyqCKBC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3208439},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"3edefedf592ecc75628543491b3e4572795a0f92","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./node_modules ./coverage ./dist","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublishOnly":"pnpm build","test:services:stop":"docker compose down","test:services:start":"docker compose up -d"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_npmVersion":"10.9.4","description":"Nodejs Memcache Client","directories":{},"_nodeVersion":"22.21.1","dependencies":{"rimraf":"^6.1.0","hookified":"^1.12.2"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","tsup":"^8.5.0","vitest":"^4.0.6","typescript":"^5.9.3","@types/node":"^24.10.0","@biomejs/biome":"^2.3.2","@vitest/coverage-v8":"^4.0.6"},"_npmOperationalInternal":{"tmp":"tmp/memcache_1.0.0_1762152948090_0.562450132271112","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"memcache","version":"1.1.0","keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"memcache@1.1.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"dist":{"shasum":"3c8894a7947624305a86a93136632733e2ba5a29","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.1.0.tgz","fileCount":7,"integrity":"sha512-KI2RbreN7jWIEjcSj0v2PFUIS7K0KoJ2bK2EHU8ODVN0hloKsA2TJAiaYW5Hlfsn6vbD/lmsQ4lqaXy8v5M9xA==","signatures":[{"sig":"MEUCIQCaKc2ny+6EqeCp//WGa/mVlZX3a8xbKws2lpslqNhp2QIgH2RP8kOaXU3vQRtxMWA/pvQ8NQN93SY7krirJ/2EdvU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145466},"main":"dist/index.js","type":"module","_from":"file:memcache-1.1.0.tgz","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./node_modules ./coverage ./dist","test:ci":"biome check --error-on-warnings && vitest run --coverage","test:services:stop":"docker compose down","test:services:start":"docker compose up -d"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/f612962e473c599f63e76eddd0d582d1/memcache-1.1.0.tgz","_integrity":"sha512-KI2RbreN7jWIEjcSj0v2PFUIS7K0KoJ2bK2EHU8ODVN0hloKsA2TJAiaYW5Hlfsn6vbD/lmsQ4lqaXy8v5M9xA==","_npmVersion":"11.6.0","description":"Nodejs Memcache Client","directories":{},"_nodeVersion":"22.12.0","dependencies":{"rimraf":"^6.1.2","hookified":"^1.13.0"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","tsup":"^8.5.1","vitest":"^4.0.13","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.7","@vitest/coverage-v8":"^4.0.13"},"_npmOperationalInternal":{"tmp":"tmp/memcache_1.1.0_1764014585395_0.9284952717705728","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"memcache","version":"1.2.0","keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"memcache@1.2.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"dist":{"shasum":"b9e03eafaffe00f369ebddab4a93aba17a54f0d6","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.2.0.tgz","fileCount":7,"integrity":"sha512-Z3tPoKTshzx6ETNHPs34/2IGcl31UIe5xzFYclRVtvhd8fUbmWchqyk+OjHZ1YjEPe/J4tb5134ewVhFg8U1ew==","signatures":[{"sig":"MEQCIAsj5hFz3AYXfEEF3qu7lyGtg351sZcj4gvgngFLKrAPAiAYRAuxoGrpm996b+yzU8xISoagoNMS4VFfsG9lbdpmuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":144042},"main":"dist/index.js","type":"module","_from":"file:memcache-1.2.0.tgz","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./node_modules ./coverage ./dist","test:ci":"biome check --error-on-warnings && vitest run --coverage","test:services:stop":"docker compose down","test:services:start":"docker compose up -d"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/57137fc77f7ebdde917d73a50fc0a997/memcache-1.2.0.tgz","_integrity":"sha512-Z3tPoKTshzx6ETNHPs34/2IGcl31UIe5xzFYclRVtvhd8fUbmWchqyk+OjHZ1YjEPe/J4tb5134ewVhFg8U1ew==","_npmVersion":"11.6.0","description":"Nodejs Memcache Client","directories":{},"_nodeVersion":"22.12.0","dependencies":{"rimraf":"^6.1.2","hookified":"^1.14.0"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","tsup":"^8.5.1","vitest":"^4.0.16","typescript":"^5.9.3","@types/node":"^25.0.3","@biomejs/biome":"^2.3.10","@vitest/coverage-v8":"^4.0.16"},"_npmOperationalInternal":{"tmp":"tmp/memcache_1.2.0_1766353771920_0.4444275578471333","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"memcache","version":"1.3.0","keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"memcache@1.3.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"dist":{"shasum":"70d23462b18d0dc2a14cfb84518adc178e98c296","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.3.0.tgz","fileCount":7,"integrity":"sha512-WeV0MLLUpIA3+3xn300O87gh61mj559DJ/HnsNEHxAvJNfacSVTtfPKBYsB4HDbAMLSo+nfmZZrDWDVhJ/cIfA==","signatures":[{"sig":"MEUCIQDKs91YnUSLcqF3YF8E9VDj7qfOLm3MV9Dhy/YpUTQ7fQIgZlwg8Mq/bg2JbhclQNij3+NpKlyxC5dkKZ5qhTbNFJs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":230404},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"0b5d1633ba24f942343f5ddf32c0b834b4b4010d","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./node_modules ./coverage ./dist","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublishOnly":"pnpm build","test:services:stop":"docker compose down","test:services:start":"docker compose up -d"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_npmVersion":"11.6.2","description":"Nodejs Memcache Client","directories":{},"_nodeVersion":"24.12.0","dependencies":{"hookified":"^1.15.0"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.0.17","typescript":"^5.9.3","@types/node":"^25.0.9","@biomejs/biome":"^2.3.11","@faker-js/faker":"^10.2.0","@vitest/coverage-v8":"^4.0.17"},"_npmOperationalInternal":{"tmp":"tmp/memcache_1.3.0_1768841518882_0.6437110601319838","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"memcache","version":"1.4.0","keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"memcache@1.4.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/memcache#readme","bugs":{"url":"https://github.com/jaredwray/memcache/issues"},"dist":{"shasum":"62428abc7433dfa8c849fe30a9d500250473f0a6","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.4.0.tgz","fileCount":7,"integrity":"sha512-rxvbw4H5F8eiHpGyP7nsz0xwy33sFpPNlyDho1P7Dj31llHrE5MzF7uqImXOp9T+DSGRmib26Q60SsrTZfUBgw==","signatures":[{"sig":"MEUCIQCDbD+EI+DPQsTI2ZN+p+mc0epV1Z+hoqKmHErX3FO3FQIgUUN88+5a8JL4SOE5Ahc34+e1BAL1dRNENtZhFmUS5jo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":267439},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"859b3caaa89d13d1dd8051be3de79ca3d839cef9","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./node_modules ./coverage ./dist","test:ci":"biome check --error-on-warnings && vitest run --coverage","benchmark":"pnpm tsx benchmark/set-get.ts","prepublishOnly":"pnpm build","test:services:stop":"docker compose down","test:services:start":"docker compose up -d"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"repository":{"url":"git+https://github.com/jaredwray/memcache.git","type":"git"},"_npmVersion":"11.6.2","description":"Nodejs Memcache Client","directories":{},"_nodeVersion":"24.13.0","dependencies":{"hookified":"^1.15.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","memjs":"^1.3.2","rimraf":"^6.1.2","vitest":"^4.0.18","memcached":"^2.2.2","tinybench":"^6.0.0","typescript":"^5.9.3","@types/node":"^25.2.3","@types/memjs":"^1.3.3","@biomejs/biome":"^2.3.15","@faker-js/faker":"^10.3.0","@types/memcached":"^2.2.10","@vitest/coverage-v8":"^4.0.18","@monstermann/tinybench-pretty-printer":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memcache_1.4.0_1771286117720_0.0024684895664552897","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"memcache","version":"1.5.0","keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"memcache@1.5.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/memcache#readme","bugs":{"url":"https://github.com/jaredwray/memcache/issues"},"dist":{"shasum":"16c488be640a5d928f570ed186fb74a25489b84f","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.5.0.tgz","fileCount":7,"integrity":"sha512-kAEwQLfRklcca0tAzFPU1Nt81Hty3wIxpclL8f3afH/rzdOfPEpZuKdX5X7siwd7ZWxvpFshAYxJyQdKlM05Ow==","signatures":[{"sig":"MEQCIHwYCaPO4Pam3+aarBwl86Acu5/LhQZuWqK3Zj0JwHNTAiBBn4tSCZ8vfRQ84w5Cv/8sVMw6Ql6Ew/viMa5A1mUs+w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":275930},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"2d0accb2d6d0c25e6e9f0ad51da0433be64ba92b","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./node_modules ./coverage ./dist","test:ci":"biome check --error-on-warnings && vitest run --coverage","benchmark":"pnpm tsx benchmark/set-get.ts","prepublishOnly":"pnpm build","test:services:stop":"docker compose down","test:services:start":"docker compose up -d"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"repository":{"url":"git+https://github.com/jaredwray/memcache.git","type":"git"},"_npmVersion":"11.9.0","description":"Nodejs Memcache Client","directories":{},"_nodeVersion":"24.14.0","dependencies":{"hookified":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","memjs":"^1.3.2","rimraf":"^6.1.3","vitest":"^4.1.0","memcached":"^2.2.2","tinybench":"^6.0.0","typescript":"^5.9.3","@types/node":"^25.5.0","@types/memjs":"^1.3.3","@biomejs/biome":"^2.4.7","@faker-js/faker":"^10.3.0","@types/memcached":"^2.2.10","@vitest/coverage-v8":"^4.1.0","@monstermann/tinybench-pretty-printer":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memcache_1.5.0_1773759125952_0.5517911841617891","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"memcache","version":"1.6.0","description":"Nodejs Memcache Client","main":"./dist/index.cjs","type":"module","types":"./dist/index.d.cts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"build":"tsdown","prepublishOnly":"pnpm build","lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","test:ci":"biome check --error-on-warnings && vitest run --coverage","test:services:start":"docker compose up -d","test:services:stop":"docker compose down","clean":"rimraf ./node_modules ./coverage ./dist","benchmark":"pnpm tsx benchmark/set-get.ts"},"keywords":["memcache","memcached","driver","client","nodejs"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/jaredwray/memcache.git"},"bugs":{"url":"https://github.com/jaredwray/memcache/issues"},"homepage":"https://github.com/jaredwray/memcache#readme","devDependencies":{"@biomejs/biome":"^2.4.11","@faker-js/faker":"^10.4.0","@monstermann/tinybench-pretty-printer":"^0.3.0","@types/memcached":"^2.2.10","@types/memjs":"^1.3.3","@types/node":"^25.6.0","@vitest/coverage-v8":"^4.1.4","memcached":"^2.2.2","memjs":"^1.3.2","rimraf":"^6.1.3","tinybench":"^6.0.0","tsdown":"^0.21.7","tsx":"^4.21.0","typescript":"^6.0.2","vitest":"^4.1.4"},"dependencies":{"hookified":"^2.1.1"},"module":"./dist/index.mjs","gitHead":"e7532dd0d3e079c300d73cb8178719d1466d5c2b","_id":"memcache@1.6.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-6STt9v3vYqJAF/96ARkdaT1p68ResowxfXAiVOuDTKpPaXLAWHMME6EWsy9QywM+a8TZJJhpkfqNXTnuiFW+Gg==","shasum":"c26fcee6c0bedb6187f4ecc9cc6f06c193859696","tarball":"https://registry.npmjs.org/memcache/-/memcache-1.6.0.tgz","fileCount":7,"unpackedSize":280468,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICyelWo2k1oNIY1Uaiis9ZtTE4cKwelw5ijnY0fRz3jEAiEAlkFU7sMC8iTNhL6tNZW1NLg42B49ng6P/zjkDAJBSqg="}]},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"directories":{},"maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memcache_1.6.0_1776035996835_0.4122806028450583"},"_hasShrinkwrap":false}},"time":{"created":"2011-04-07T22:47:15.050Z","modified":"2026-04-12T23:19:57.063Z","0.1.1":"2011-04-07T22:47:15.488Z","0.2.0":"2011-05-20T17:27:20.559Z","0.3.0":"2012-01-29T19:45:03.723Z","1.0.0":"2025-11-03T06:55:48.437Z","1.1.0":"2025-11-24T20:03:05.573Z","1.2.0":"2025-12-21T21:49:32.118Z","1.3.0":"2026-01-19T16:51:59.055Z","1.4.0":"2026-02-16T23:55:17.855Z","1.5.0":"2026-03-17T14:52:06.121Z","1.6.0":"2026-04-12T23:19:56.955Z"},"bugs":{"url":"https://github.com/jaredwray/memcache/issues"},"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","homepage":"https://github.com/jaredwray/memcache#readme","keywords":["memcache","memcached","driver","client","nodejs"],"repository":{"type":"git","url":"git+https://github.com/jaredwray/memcache.git"},"description":"Nodejs Memcache Client","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"readme":"[<img src=\"https://jaredwray.com/images/memcache.svg\" width=\"80%\" height=\"80%\" align=\"center\" alt=\"Memcache Logo\" align=\"center\">](https://memcachejs.org)\n\n[![codecov](https://codecov.io/gh/jaredwray/memcache/graph/badge.svg?token=4DUANNWiIE)](https://codecov.io/gh/jaredwray/memcache)\n[![tests](https://github.com/jaredwray/memcache/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/memcache/actions/workflows/tests.yaml)\n[![npm](https://img.shields.io/npm/v/memcache)](https://www.npmjs.com/package/memcache)\n[![npm](https://img.shields.io/npm/dm/memcache)](https://www.npmjs.com/package/memcache)\n[![license](https://img.shields.io/github/license/jaredwray/memcache)](https://github.com/jaredwray/memcache/blob/main/LICENSE)\n\n# Memcache\nNodejs Memcache Client\n\n# Table of Contents\n\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Basic Usage](#basic-usage)\n- [API](#api)\n  - [Constructor](#constructor)\n  - [Properties](#properties)\n  - [Connection Management](#connection-management)\n  - [Node Management](#node-management)\n  - [Data Storage Operations](#data-storage-operations)\n  - [String Modification Operations](#string-modification-operations)\n  - [Deletion & Expiration](#deletion--expiration)\n  - [Numeric Operations](#numeric-operations)\n  - [Server Management & Statistics](#server-management--statistics)\n  - [Validation](#validation)\n  - [Helper Functions](#helper-functions)\n- [Hooks and Events](#hooks-and-events)\n  - [Events](#events)\n  - [Available Events](#available-events)\n  - [Hooks](#hooks)\n  - [Available Hooks](#available-hooks)\n    - [get(key)](#getkey)\n    - [set(key, value, exptime?, flags?)](#setkey-value-exptime-flags)\n    - [gets(keys[])](#getskeys)\n    - [add(key, value, exptime?, flags?)](#addkey-value-exptime-flags)\n    - [replace(key, value, exptime?, flags?)](#replacekey-value-exptime-flags)\n    - [append(key, value)](#appendkey-value)\n    - [prepend(key, value)](#prependkey-value)\n    - [delete(key)](#deletekey)\n    - [incr(key, value?)](#incrkey-value)\n    - [decr(key, value?)](#decrkey-value)\n    - [touch(key, exptime)](#touchkey-exptime)\n  - [Hook Examples](#hook-examples)\n- [Distribution Algorithms](#distribution-algorithms)\n  - [KetamaHash (Default)](#ketamahash-default)\n  - [ModulaHash](#modulahash)\n  - [BroadcastHash](#broadcasthash)\n  - [Choosing an Algorithm](#choosing-an-algorithm)\n- [Retry Configuration](#retry-configuration)\n  - [Basic Retry Setup](#basic-retry-setup)\n  - [Backoff Strategies](#backoff-strategies)\n  - [Idempotent Safety](#idempotent-safety)\n  - [Methods Without Retry Support](#methods-without-retry-support)\n- [SASL Authentication](#sasl-authentication)\n  - [Enabling SASL Authentication](#enabling-sasl-authentication)\n  - [SASL Options](#sasl-options)\n  - [Per-Node SASL Configuration](#per-node-sasl-configuration)\n  - [Authentication Events](#authentication-events)\n  - [Server Configuration](#server-configuration)\n- [Auto Discovery](#auto-discovery)\n  - [Enabling Auto Discovery](#enabling-auto-discovery)\n  - [Auto Discovery Options](#auto-discovery-options)\n  - [Auto Discovery Events](#auto-discovery-events)\n  - [Legacy Command Support](#legacy-command-support)\n- [IPv6 Support](#ipv6-support)\n- [Benchmarks](#benchmarks)\n- [Contributing](#contributing)\n- [License and Copyright](#license-and-copyright)\n\n# Getting Started\n\n## Installation\n\n```bash\nnpm install memcache\n```\n\nor with pnpm:\n\n```bash\npnpm add memcache\n```\n\n## Basic Usage\n\n```javascript\nimport { Memcache } from 'memcache';\n\n// Create a new client\nconst client = new Memcache();\n\n// Set a value\nawait client.set('mykey', 'Hello, Memcache!');\n\n// Get a value\nconst value = await client.get('mykey');\nconsole.log(value); // ['Hello, Memcache!']\n\n// Delete a value\nawait client.delete('mykey');\n\n// Close the connection\nawait client.quit();\n```\n\nYou can also just pass in the `uri` into the constructor\n\n```javascript\n// Single node as string\nconst client = new Memcache('localhost:11211');\n\n// Single node with protocol\nconst client = new Memcache('memcache://192.168.1.100:11211');\n\n// Multiple nodes with options\nconst client = new Memcache({\n  nodes: ['localhost:11211', 'server2:11211'],\n  timeout: 10000\n});\n```\n\nYou can specify multiple Memcache nodes by passing an array of connection strings:\n\n```javascript\nimport { Memcache } from 'memcache';\n\n// Create a client with multiple nodes\nconst client = new Memcache({\n  nodes: ['localhost:11211', '192.168.1.100:11211', 'memcache://192.168.1.101:11211']\n});\n\n// Set and get values (automatically distributed across nodes)\nawait client.set('mykey', 'Hello, Memcache!');\nconst value = await client.get('mykey');\nconsole.log(value); // ['Hello, Memcache!']\n\n// Close the connection\nawait client.quit();\n```\n\nYou can also pass an array of MemcacheNode instances for advanced configuration:\n\n```javascript\nimport { Memcache, createNode } from 'memcache';\n\n// Create nodes with custom settings\nconst node1 = createNode('localhost', 11211, { weight: 2 });\nconst node2 = createNode('192.168.1.100', 11211, { weight: 1 });\nconst node3 = createNode('192.168.1.101', 11211, { weight: 1 });\n\n// Create a client with MemcacheNode instances\nconst client = new Memcache({\n  nodes: [node1, node2, node3],\n  timeout: 10000\n});\n\n// node1 will receive twice as much traffic due to higher weight\nawait client.set('mykey', 'Hello, Memcache!');\nconst value = await client.get('mykey');\nconsole.log(value); // ['Hello, Memcache!']\n\n// Close the connection\nawait client.quit();\n```\n\n# API\n\n## Constructor\n\n```typescript\nnew Memcache(options?: string | MemcacheOptions)\n```\n\nCreates a new Memcache client instance. You can pass either:\n- A **string** representing a single node URI (uses default settings)\n- A **MemcacheOptions** object for custom configuration\n\n**Examples:**\n\n```javascript\n// Single node as string\nconst client = new Memcache('localhost:11211');\n\n// Single node with protocol\nconst client = new Memcache('memcache://192.168.1.100:11211');\n\n// Multiple nodes with options\nconst client = new Memcache({\n  nodes: ['localhost:11211', 'server2:11211'],\n  timeout: 10000\n});\n```\n\n### Options\n\n- `nodes?: (string | MemcacheNode)[]` - Array of node URIs or MemcacheNode instances\n  - Examples: `[\"localhost:11211\", \"memcache://192.168.1.100:11212\"]`\n- `timeout?: number` - Operation timeout in milliseconds (default: 5000)\n- `keepAlive?: boolean` - Keep connection alive (default: true)\n- `keepAliveDelay?: number` - Keep alive delay in milliseconds (default: 1000)\n- `hash?: HashProvider` - Hash provider for consistent hashing (default: KetamaHash)\n- `retries?: number` - Number of retry attempts for failed commands (default: 0)\n- `retryDelay?: number` - Base delay in milliseconds between retries (default: 100)\n- `retryBackoff?: RetryBackoffFunction` - Function to calculate backoff delay (default: fixed delay)\n- `retryOnlyIdempotent?: boolean` - Only retry commands marked as idempotent (default: true)\n- `lazyConnect?: boolean` - When `true`, nodes will not connect until the first command is executed. When `false`, nodes connect eagerly during construction (default: true)\n- `autoDiscover?: AutoDiscoverOptions` - AWS ElastiCache Auto Discovery configuration (see [Auto Discovery](#auto-discovery))\n\n## Properties\n\n### `nodes: MemcacheNode[]` (readonly)\nReturns the list of all MemcacheNode instances in the cluster.\n\n### `nodeIds: string[]` (readonly)\nReturns the list of node IDs (e.g., `[\"localhost:11211\", \"127.0.0.1:11212\"]`).\n\n### `hash: HashProvider`\nGet or set the hash provider used for consistent hashing distribution.\n\n### `timeout: number`\nGet or set the timeout for operations in milliseconds (default: 5000).\n\n### `keepAlive: boolean`\nGet or set the keepAlive setting. Updates all existing nodes. Requires `reconnect()` to apply changes.\n\n### `keepAliveDelay: number`\nGet or set the keep alive delay in milliseconds. Updates all existing nodes. Requires `reconnect()` to apply changes.\n\n### `retries: number`\nGet or set the number of retry attempts for failed commands (default: 0).\n\n### `retryDelay: number`\nGet or set the base delay in milliseconds between retry attempts (default: 100).\n\n### `retryBackoff: RetryBackoffFunction`\nGet or set the backoff function for calculating retry delays.\n\n### `retryOnlyIdempotent: boolean`\nGet or set whether retries are restricted to idempotent commands only (default: true).\n\n### `lazyConnect: boolean` (readonly)\nWhether nodes defer connecting until the first command is executed (default: true).\n\n## Connection Management\n\n### `connect(nodeId?: string): Promise<void>`\nConnect to all Memcache servers or a specific node.\n\n### `disconnect(): Promise<void>`\nDisconnect all connections.\n\n### `reconnect(): Promise<void>`\nReconnect all nodes by disconnecting and connecting them again.\n\n### `quit(): Promise<void>`\nQuit all connections gracefully.\n\n### `isConnected(): boolean`\nCheck if any node is connected to a Memcache server.\n\n## Node Management\n\n### `getNodes(): MemcacheNode[]`\nGet an array of all MemcacheNode instances.\n\n### `getNode(id: string): MemcacheNode | undefined`\nGet a specific node by its ID (e.g., `\"localhost:11211\"`).\n\n### `addNode(uri: string | MemcacheNode, weight?: number): Promise<void>`\nAdd a new node to the cluster. Throws error if node already exists.\n\n### `removeNode(uri: string): Promise<void>`\nRemove a node from the cluster.\n\n### `getNodesByKey(key: string): Promise<MemcacheNode[]>`\nGet the nodes for a given key using consistent hashing. Automatically connects to nodes if not already connected.\n\n### `parseUri(uri: string): { host: string; port: number }`\nParse a URI string into host and port. Supports formats:\n- Simple: `\"localhost:11211\"` or `\"localhost\"`\n- Protocol: `\"memcache://localhost:11211\"`, `\"tcp://localhost:11211\"`\n- IPv6: `\"[::1]:11211\"` or `\"memcache://[2001:db8::1]:11212\"`\n- Unix socket: `\"/var/run/memcached.sock\"` or `\"unix:///var/run/memcached.sock\"`\n\n## Data Storage Operations\n\n### `get(key: string): Promise<string | undefined>`\nGet a value from the Memcache server. Returns the first successful result from replica nodes.\n\n### `gets(keys: string[]): Promise<Map<string, string>>`\nGet multiple values from the Memcache server. Returns a Map with keys to values.\n\n### `set(key: string, value: string, exptime?: number, flags?: number): Promise<boolean>`\nSet a value in the Memcache server. Returns true only if all replica nodes succeed.\n- `exptime` - Expiration time in seconds (default: 0 = never expire)\n- `flags` - Flags/metadata (default: 0)\n\n### `add(key: string, value: string, exptime?: number, flags?: number): Promise<boolean>`\nAdd a value (only if key doesn't exist). Returns true only if all replica nodes succeed.\n\n### `replace(key: string, value: string, exptime?: number, flags?: number): Promise<boolean>`\nReplace a value (only if key exists). Returns true only if all replica nodes succeed.\n\n### `cas(key: string, value: string, casToken: string, exptime?: number, flags?: number): Promise<boolean>`\nCheck-And-Set: Store a value only if it hasn't been modified since last fetch. Returns true only if all replica nodes succeed.\n\n## String Modification Operations\n\n### `append(key: string, value: string): Promise<boolean>`\nAppend a value to an existing key. Returns true only if all replica nodes succeed.\n\n### `prepend(key: string, value: string): Promise<boolean>`\nPrepend a value to an existing key. Returns true only if all replica nodes succeed.\n\n## Deletion & Expiration\n\n### `delete(key: string): Promise<boolean>`\nDelete a value from the Memcache server. Returns true only if all replica nodes succeed.\n\n### `touch(key: string, exptime: number): Promise<boolean>`\nUpdate expiration time without retrieving value. Returns true only if all replica nodes succeed.\n\n## Numeric Operations\n\n### `incr(key: string, value?: number): Promise<number | undefined>`\nIncrement a value. Returns the new value or undefined on failure.\n- `value` - Amount to increment (default: 1)\n\n### `decr(key: string, value?: number): Promise<number | undefined>`\nDecrement a value. Returns the new value or undefined on failure.\n- `value` - Amount to decrement (default: 1)\n\n## Server Management & Statistics\n\n### `flush(delay?: number): Promise<boolean>`\nFlush all values from all Memcache servers. Returns true if all nodes successfully flushed.\n- `delay` - Optional delay in seconds before flushing\n\n### `stats(type?: string): Promise<Map<string, MemcacheStats>>`\nGet statistics from all Memcache servers. Returns a Map of node IDs to their stats.\n\n### `version(): Promise<Map<string, string>>`\nGet the Memcache server version from all nodes. Returns a Map of node IDs to version strings.\n\n## Validation\n\n### `validateKey(key: string): void`\nValidates a Memcache key according to protocol requirements. Throws error if:\n- Key is empty\n- Key exceeds 250 characters\n- Key contains spaces, newlines, or null characters\n\n## Helper Functions\n\n### `createNode(host: string, port: number, options?: MemcacheNodeOptions): MemcacheNode`\nFactory function to create a new MemcacheNode instance.\n\n```javascript\nimport { createNode } from 'memcache';\n\nconst node = createNode('localhost', 11211, {\n  timeout: 5000,\n  keepAlive: true,\n  weight: 1\n});\n```\n\n# Hooks and Events\n\nThe Memcache client extends [Hookified](https://github.com/jaredwray/hookified) to provide powerful hooks and events for monitoring and customizing behavior.\n\n## Events\n\nThe client emits various events during operations that you can listen to:\n\n```javascript\nconst client = new Memcache();\n\n// Connection events\nclient.on('connect', () => {\n  console.log('Connected to Memcache server');\n});\n\nclient.on('close', () => {\n  console.log('Connection closed');\n});\n\nclient.on('error', (error) => {\n  console.error('Error:', error);\n});\n\nclient.on('timeout', () => {\n  console.log('Connection timeout');\n});\n\n// Cache hit/miss events\nclient.on('hit', (key, value) => {\n  console.log(`Cache hit for key: ${key}`);\n});\n\nclient.on('miss', (key) => {\n  console.log(`Cache miss for key: ${key}`);\n});\n```\n\n## Available Events\n\n- `connect` - Emitted when connection to Memcache server is established\n- `close` - Emitted when connection is closed\n- `error` - Emitted when an error occurs\n- `timeout` - Emitted when a connection timeout occurs\n- `hit` - Emitted when a key is found in cache (includes key and value)\n- `miss` - Emitted when a key is not found in cache\n- `quit` - Emitted when quit command is sent\n- `warn` - Emitted for warning messages\n- `info` - Emitted for informational messages\n- `autoDiscover` - Emitted on initial auto discovery with the cluster config\n- `autoDiscoverUpdate` - Emitted when auto discovery detects a topology change\n- `autoDiscoverError` - Emitted when auto discovery encounters an error\n\n## Hooks\n\nHooks allow you to intercept and modify behavior before and after operations. Every operation supports `before` and `after` hooks.\n\n```javascript\nconst client = new Memcache();\n\n// Add a before hook for get operations\nclient.onHook('before:get', async ({ key }) => {\n  console.log(`Getting key: ${key}`);\n});\n\n// Add an after hook for set operations\nclient.onHook('after:set', async ({ key, value, success }) => {\n  if (success) {\n    console.log(`Successfully set ${key}`);\n  }\n});\n\n// Hooks can be async and modify behavior\nclient.onHook('before:set', async ({ key, value }) => {\n  console.log(`About to set ${key} = ${value}`);\n  // Perform validation, logging, etc.\n});\n```\n\n## Available Hooks\n\nAll operations support before and after hooks with specific parameters:\n\n## get(key)\n- `before:get` - `{ key }`\n- `after:get` - `{ key, value }` (value is array or undefined)\n\n## set(key, value, exptime?, flags?)\n- `before:set` - `{ key, value, exptime, flags }`\n- `after:set` - `{ key, value, exptime, flags, success }`\n\n## gets(keys[])\n- `before:gets` - `{ keys }`\n- `after:gets` - `{ keys, values }` (values is a Map)\n\n## add(key, value, exptime?, flags?)\n- `before:add` - `{ key, value, exptime, flags }`\n- `after:add` - `{ key, value, exptime, flags, success }`\n\n## replace(key, value, exptime?, flags?)\n- `before:replace` - `{ key, value, exptime, flags }`\n- `after:replace` - `{ key, value, exptime, flags, success }`\n\n## append(key, value)\n- `before:append` - `{ key, value }`\n- `after:append` - `{ key, value, success }`\n\n## prepend(key, value)\n- `before:prepend` - `{ key, value }`\n- `after:prepend` - `{ key, value, success }`\n\n## delete(key)\n- `before:delete` - `{ key }`\n- `after:delete` - `{ key, success }`\n\n## incr(key, value?)\n- `before:incr` - `{ key, value }`\n- `after:incr` - `{ key, value, newValue }`\n\n## decr(key, value?)\n- `before:decr` - `{ key, value }`\n- `after:decr` - `{ key, value, newValue }`\n\n## touch(key, exptime)\n- `before:touch` - `{ key, exptime }`\n- `after:touch` - `{ key, exptime, success }`\n\n## Hook Examples\n\n```javascript\nconst client = new Memcache();\n\n// Log all get operations\nclient.onHook('before:get', async ({ key }) => {\n  console.log(`[GET] Fetching key: ${key}`);\n});\n\nclient.onHook('after:get', async ({ key, value }) => {\n  console.log(`[GET] Key: ${key}, Found: ${value !== undefined}`);\n});\n\n// Log all set operations with timing\nclient.onHook('before:set', async (context) => {\n  context.startTime = Date.now();\n});\n\nclient.onHook('after:set', async (context) => {\n  const duration = Date.now() - context.startTime;\n  console.log(`[SET] Key: ${context.key}, Success: ${context.success}, Time: ${duration}ms`);\n});\n```\n\n# Distribution Algorithms\n\nMemcache supports pluggable distribution algorithms to determine how keys are distributed across nodes. You can configure the algorithm using the `hash` option.\n\n## KetamaHash (Default)\n\nKetamaHash uses the Ketama consistent hashing algorithm, which minimizes key redistribution when nodes are added or removed. This is the default and recommended algorithm for production environments with dynamic scaling.\n\n```javascript\nimport { Memcache } from 'memcache';\n\n// KetamaHash is used by default\nconst client = new Memcache({\n  nodes: ['server1:11211', 'server2:11211', 'server3:11211']\n});\n```\n\n**Characteristics:**\n- Minimal key redistribution (~1/n keys move when adding/removing nodes)\n- Uses virtual nodes for better distribution\n- Supports weighted nodes\n- Best for production environments with dynamic scaling\n\n## ModulaHash\n\nModulaHash uses a simple modulo-based hashing algorithm (`hash(key) % nodeCount`). This is a simpler algorithm that may redistribute all keys when nodes change.\n\n```javascript\nimport { Memcache, ModulaHash } from 'memcache';\n\n// Use ModulaHash for distribution\nconst client = new Memcache({\n  nodes: ['server1:11211', 'server2:11211', 'server3:11211'],\n  hash: new ModulaHash()\n});\n\n// With a custom hash algorithm (default is sha1)\nconst client2 = new Memcache({\n  nodes: ['server1:11211', 'server2:11211'],\n  hash: new ModulaHash('md5')\n});\n```\n\n**Characteristics:**\n- Simple and fast algorithm\n- All keys may be redistributed when nodes are added or removed\n- Supports weighted nodes (nodes with higher weight appear more in the distribution)\n- Best for fixed-size clusters or testing environments\n\n### Weighted Nodes with ModulaHash\n\nModulaHash supports weighted nodes, where nodes with higher weights receive proportionally more keys:\n\n```javascript\nimport { Memcache, ModulaHash, createNode } from 'memcache';\n\n// Create nodes with different weights\nconst node1 = createNode('server1', 11211, { weight: 3 }); // 3x traffic\nconst node2 = createNode('server2', 11211, { weight: 1 }); // 1x traffic\n\nconst client = new Memcache({\n  nodes: [node1, node2],\n  hash: new ModulaHash()\n});\n\n// server1 will receive approximately 75% of keys\n// server2 will receive approximately 25% of keys\n```\n\n## BroadcastHash\n\nBroadcastHash sends every operation to all nodes in the cluster. Instead of partitioning keys across nodes, every `getNodesByKey()` call returns all nodes, so reads and writes are broadcast to every server.\n\n```javascript\nimport { Memcache, BroadcastHash } from 'memcache';\n\n// Use BroadcastHash for full replication\nconst client = new Memcache({\n  nodes: ['server1:11211', 'server2:11211', 'server3:11211'],\n  hash: new BroadcastHash()\n});\n\n// Every set/get/delete hits all three nodes\nawait client.set('mykey', 'Hello!');\n```\n\n**Characteristics:**\n- Every operation targets all nodes\n- No key partitioning — all nodes hold the same data\n- Reads return the first successful result from any node\n- Writes succeed only if all nodes succeed\n- Best for replication, broadcast invalidation, or small clusters where all nodes should be in sync\n\n## Choosing an Algorithm\n\n| Feature | KetamaHash | ModulaHash | BroadcastHash |\n|---------|------------|------------|---------------|\n| Key redistribution on node change | Minimal (~1/n keys) | All keys may move | N/A (all nodes always) |\n| Complexity | Higher (virtual nodes) | Lower (simple modulo) | Simplest |\n| Performance | Slightly slower | Faster | Depends on node count |\n| Best for | Dynamic scaling | Fixed clusters | Replication |\n| Weighted nodes | Yes | Yes | No |\n\n**Use KetamaHash (default) when:**\n- Your cluster size may change dynamically\n- You want to minimize cache invalidation during scaling\n- You're running in production\n\n**Use ModulaHash when:**\n- Your cluster size is fixed\n- You prefer simplicity over minimal redistribution\n- You're in a testing or development environment\n\n**Use BroadcastHash when:**\n- You want all nodes to hold the same data\n- You need broadcast cache invalidation across all nodes\n- You're running a small cluster where replication is more important than partitioning\n\n# Retry Configuration\n\nThe Memcache client supports automatic retry of failed commands with configurable backoff strategies.\n\n## Basic Retry Setup\n\nEnable retries by setting the `retries` option:\n\n```javascript\nimport { Memcache } from 'memcache';\n\nconst client = new Memcache({\n  nodes: ['localhost:11211'],\n  retries: 3,        // Retry up to 3 times\n  retryDelay: 100    // 100ms between retries\n});\n```\n\nYou can also modify retry settings at runtime:\n\n```javascript\nclient.retries = 5;\nclient.retryDelay = 200;\n```\n\n## Backoff Strategies\n\nThe client includes two built-in backoff functions:\n\n### Fixed Delay (Default)\n\n```javascript\nimport { Memcache, defaultRetryBackoff } from 'memcache';\n\nconst client = new Memcache({\n  retries: 3,\n  retryDelay: 100,\n  retryBackoff: defaultRetryBackoff  // 100ms, 100ms, 100ms\n});\n```\n\n### Exponential Backoff\n\n```javascript\nimport { Memcache, exponentialRetryBackoff } from 'memcache';\n\nconst client = new Memcache({\n  retries: 3,\n  retryDelay: 100,\n  retryBackoff: exponentialRetryBackoff  // 100ms, 200ms, 400ms\n});\n```\n\n### Custom Backoff Function\n\nYou can provide your own backoff function:\n\n```javascript\nconst client = new Memcache({\n  retries: 3,\n  retryDelay: 100,\n  retryBackoff: (attempt, baseDelay) => {\n    // Exponential backoff with jitter\n    const delay = baseDelay * Math.pow(2, attempt);\n    return delay + Math.random() * delay * 0.1;\n  }\n});\n```\n\nThe backoff function receives:\n- `attempt` - The current attempt number (0-indexed)\n- `baseDelay` - The configured `retryDelay` value\n\n## Idempotent Safety\n\n**Important:** By default, retries are only performed for commands explicitly marked as idempotent. This prevents accidental double-execution of non-idempotent operations like `incr`, `decr`, `append`, and `prepend`.\n\n### Why This Matters\n\nIf a network timeout occurs after the server applies a mutation but before the client receives the response, retrying would apply the mutation twice:\n- Counter incremented twice instead of once\n- Data appended twice instead of once\n\n### Safe Usage Patterns\n\n**For read operations (always safe to retry):**\n\n```javascript\n// Mark read operations as idempotent\nawait client.execute('get mykey', nodes, { idempotent: true });\n```\n\n**For idempotent writes (safe to retry):**\n\n```javascript\n// SET with the same value is idempotent\nawait client.execute('set mykey 0 0 5\\r\\nhello', nodes, { idempotent: true });\n```\n\n**Disable safety for all commands (use with caution):**\n\n```javascript\nconst client = new Memcache({\n  retries: 3,\n  retryOnlyIdempotent: false  // Allow retries for ALL commands\n});\n```\n\n### Behavior Summary\n\n| `retryOnlyIdempotent` | `idempotent` flag | Retries enabled? |\n|-----------------------|-------------------|------------------|\n| `true` (default)      | `false` (default) | No               |\n| `true` (default)      | `true`            | Yes              |\n| `false`               | (any)             | Yes              |\n\n### Methods Without Retry Support\n\nThe following methods do not use the retry mechanism and have their own error handling:\n\n- `get()` - Returns `undefined` on failure\n- `gets()` - Returns partial results on node failure\n- `flush()` - Operates directly on nodes\n- `stats()` - Operates directly on nodes\n- `version()` - Operates directly on nodes\n\nTo use retries with read operations, use the `execute()` method directly:\n\n```javascript\nconst nodes = await client.getNodesByKey('mykey');\nconst results = await client.execute('get mykey', nodes, { idempotent: true });\n```\n\n# SASL Authentication\n\nThe Memcache client supports SASL (Simple Authentication and Security Layer) authentication using the PLAIN mechanism. This allows you to connect to memcached servers that require authentication.\n\n## Enabling SASL Authentication\n\n```javascript\nimport { Memcache } from 'memcache';\n\nconst client = new Memcache({\n  nodes: ['localhost:11211'],\n  sasl: {\n    username: 'myuser',\n    password: 'mypassword',\n  },\n});\n\nawait client.connect();\n// Client is now authenticated and ready to use\n```\n\n## SASL Options\n\nThe `sasl` option accepts an object with the following properties:\n\n- `username: string` - The username for authentication (required)\n- `password: string` - The password for authentication (required)\n- `mechanism?: 'PLAIN'` - The SASL mechanism to use (default: 'PLAIN')\n\nCurrently, only the PLAIN mechanism is supported.\n\n## Binary Protocol Methods\n\n**Important:** Memcached servers with SASL enabled (`-S` flag) require the binary protocol for all operations after authentication. The standard text-based methods (`client.get()`, `client.set()`, etc.) will not work on SASL-enabled servers.\n\nUse the `binary*` methods on nodes for SASL-enabled servers:\n\n```javascript\nimport { Memcache } from 'memcache';\n\nconst client = new Memcache({\n  nodes: ['localhost:11211'],\n  sasl: { username: 'user', password: 'pass' },\n});\n\nawait client.connect();\n\n// Access the node directly for binary operations\nconst node = client.nodes[0];\n\n// Binary protocol operations\nawait node.binarySet('mykey', 'myvalue', 3600);     // Set with 1 hour expiry\nconst value = await node.binaryGet('mykey');         // Get value\nawait node.binaryDelete('mykey');                    // Delete key\n\n// Other binary operations\nawait node.binaryAdd('newkey', 'value');             // Add (only if not exists)\nawait node.binaryReplace('existingkey', 'newvalue'); // Replace (only if exists)\nawait node.binaryIncr('counter', 1);                 // Increment\nawait node.binaryDecr('counter', 1);                 // Decrement\nawait node.binaryAppend('mykey', '-suffix');         // Append to value\nawait node.binaryPrepend('mykey', 'prefix-');        // Prepend to value\nawait node.binaryTouch('mykey', 7200);               // Update expiration\nawait node.binaryFlush();                            // Flush all\nconst version = await node.binaryVersion();          // Get server version\nconst stats = await node.binaryStats();              // Get server stats\n```\n\n## Per-Node SASL Configuration\n\nYou can also configure SASL credentials when creating individual nodes:\n\n```javascript\nimport { createNode } from 'memcache';\n\n// Create a node with SASL credentials\nconst node = createNode('localhost', 11211, {\n  sasl: { username: 'user', password: 'pass' },\n});\n\n// Connect and use binary methods\nawait node.connect();\nawait node.binarySet('mykey', 'hello');\nconst value = await node.binaryGet('mykey');\n```\n\n## Authentication Events\n\nYou can listen for authentication events on both nodes and the client:\n\n```javascript\nimport { Memcache, MemcacheNode } from 'memcache';\n\n// Node-level events\nconst node = new MemcacheNode('localhost', 11211, {\n  sasl: { username: 'user', password: 'pass' },\n});\n\nnode.on('authenticated', () => {\n  console.log('Node authenticated successfully');\n});\n\nnode.on('error', (error) => {\n  if (error.message.includes('SASL authentication failed')) {\n    console.error('Authentication failed:', error.message);\n  }\n});\n\nawait node.connect();\n\n// Client-level events (forwarded from nodes)\nconst client = new Memcache({\n  nodes: ['localhost:11211'],\n  sasl: { username: 'user', password: 'pass' },\n});\n\nclient.on('authenticated', () => {\n  console.log('Client authenticated');\n});\n\nawait client.connect();\n```\n\n### Node Properties\n\n- `node.hasSaslCredentials` - Returns `true` if SASL credentials are configured\n- `node.isAuthenticated` - Returns `true` if the node has successfully authenticated\n\n## Server Configuration\n\nTo use SASL authentication, your memcached server must be configured with SASL support:\n\n1. **Build memcached with SASL support** - Ensure memcached was compiled with `--enable-sasl`\n\n2. **Create SASL users** - Use `saslpasswd2` to create users:\n   ```bash\n   saslpasswd2 -a memcached -c username\n   ```\n\n3. **Configure SASL mechanism** - Create `/etc/sasl2/memcached.conf`:\n   ```\n   mech_list: plain\n   ```\n\n4. **Start memcached with SASL** - Use the `-S` flag:\n   ```bash\n   memcached -S -m 64 -p 11211\n   ```\n\nFor more details, see the [memcached SASL documentation](https://github.com/memcached/memcached/wiki/SASLHowto).\n\n# Auto Discovery\n\nThe Memcache client supports AWS ElastiCache Auto Discovery, which automatically detects cluster topology changes and adds or removes nodes as needed. When enabled, the client connects to a configuration endpoint, retrieves the current list of cache nodes, and periodically polls for changes.\n\n## Enabling Auto Discovery\n\n```javascript\nimport { Memcache } from 'memcache';\n\nconst client = new Memcache({\n  nodes: [],\n  autoDiscover: {\n    enabled: true,\n    configEndpoint: 'my-cluster.cfg.use1.cache.amazonaws.com:11211',\n  },\n});\n\nawait client.connect();\n// The client automatically discovers and connects to all cluster nodes\n```\n\nIf you omit `configEndpoint`, the first node in the `nodes` array is used as the configuration endpoint:\n\n```javascript\nconst client = new Memcache({\n  nodes: ['my-cluster.cfg.use1.cache.amazonaws.com:11211'],\n  autoDiscover: {\n    enabled: true,\n  },\n});\n```\n\n## Auto Discovery Options\n\nThe `autoDiscover` option accepts an object with the following properties:\n\n- `enabled: boolean` - Enable auto discovery of cluster nodes (required)\n- `pollingInterval?: number` - How often to poll for topology changes, in milliseconds (default: 60000)\n- `configEndpoint?: string` - The configuration endpoint to use for discovery. This is typically the `.cfg` endpoint from ElastiCache. If not specified, the first node in the `nodes` array will be used\n- `useLegacyCommand?: boolean` - Use the legacy `get AmazonElastiCache:cluster` command instead of `config get cluster` (default: false)\n\n## Auto Discovery Events\n\nThe client emits events during the auto discovery lifecycle:\n\n```javascript\nconst client = new Memcache({\n  nodes: [],\n  autoDiscover: {\n    enabled: true,\n    configEndpoint: 'my-cluster.cfg.use1.cache.amazonaws.com:11211',\n  },\n});\n\n// Emitted on initial discovery with the full cluster config\nclient.on('autoDiscover', (config) => {\n  console.log('Discovered nodes:', config.nodes);\n  console.log('Config version:', config.version);\n});\n\n// Emitted when polling detects a topology change\nclient.on('autoDiscoverUpdate', (config) => {\n  console.log('Cluster topology changed:', config.nodes);\n});\n\n// Emitted when discovery encounters an error (non-fatal, retries on next poll)\nclient.on('autoDiscoverError', (error) => {\n  console.error('Discovery error:', error.message);\n});\n\nawait client.connect();\n```\n\n## Legacy Command Support\n\nFor ElastiCache engine versions older than 1.4.14, use the legacy discovery command:\n\n```javascript\nconst client = new Memcache({\n  nodes: [],\n  autoDiscover: {\n    enabled: true,\n    configEndpoint: 'my-cluster.cfg.use1.cache.amazonaws.com:11211',\n    useLegacyCommand: true, // Uses 'get AmazonElastiCache:cluster' instead of 'config get cluster'\n  },\n});\n```\n\n# IPv6 Support\n\nThe Memcache client fully supports IPv6 addresses using standard bracket notation in URIs.\n\n## Connecting to IPv6 Nodes\n\n```javascript\nimport { Memcache } from 'memcache';\n\n// IPv6 loopback\nconst client = new Memcache('[::1]:11211');\n\n// Multiple IPv6 nodes\nconst client = new Memcache({\n  nodes: [\n    '[::1]:11211',\n    '[2001:db8::1]:11211',\n    'memcache://[2001:db8::2]:11212',\n  ],\n});\n\nawait client.connect();\n```\n\n## IPv6 in Auto Discovery\n\nWhen auto discovery returns IPv6 node addresses, the client automatically brackets them for correct URI handling:\n\n```javascript\nconst client = new Memcache({\n  nodes: [],\n  autoDiscover: {\n    enabled: true,\n    configEndpoint: '[2001:db8::1]:11211',\n  },\n});\n\nawait client.connect();\n// Discovered IPv6 nodes are added as [host]:port automatically\n```\n\n## IPv6 Node IDs\n\nNode IDs for IPv6 addresses use bracket notation to avoid ambiguity:\n\n```javascript\nconst client = new Memcache({\n  nodes: ['[::1]:11211', '[2001:db8::1]:11212'],\n});\n\nconsole.log(client.nodeIds);\n// ['[::1]:11211', '[2001:db8::1]:11212']\n```\n\n# Benchmarks\n\nThese are provided to show a simple benchmark against current libraries. This is not robust but it is something we update regularly to make sure we are keeping performant.\n\n|             name             |  summary  |  ops/sec  |  time/op  |  margin  |  samples  |\n|------------------------------|:---------:|----------:|----------:|:--------:|----------:|\n|  memcache set/get (v1.4.0)   |    🥇     |       3K  |    350µs  |  ±0.19%  |      10K  |\n|  memcached set/get (v2.2.2)  |   -2.9%   |       3K  |    361µs  |  ±0.16%  |      10K  |\n|  memjs set/get (v1.3.2)      |   -12%    |       3K  |    398µs  |  ±0.17%  |      10K  |\n\n# Contributing\n\nPlease read our [Contributing Guidelines](./CONTRIBUTING.md) and also our [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n# License and Copyright\n\n[MIT & Copyright (c) Jared Wray](https://github.com/jaredwray/memcache/blob/main/LICENSE)","readmeFilename":"README.md","users":{"tetsu3a":true,"robcolbert":true}}