{"_id":"@alloc/redis-on-workers","_rev":"7-e38e7e71c46e375f4e9421d50cb7ca27","name":"@alloc/redis-on-workers","dist-tags":{"latest":"0.8.0"},"versions":{"0.4.0":{"name":"@alloc/redis-on-workers","version":"0.4.0","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"license":"MIT","_id":"@alloc/redis-on-workers@0.4.0","maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"contributors":[{"name":"Kane Wang"}],"homepage":"https://github.com/alloc/redis-on-workers#readme","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"dist":{"shasum":"a3742ecfbbc8cdcfdf547381fb5f31ff33c9e666","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.4.0.tgz","fileCount":7,"integrity":"sha512-HPziN7VkyXlzmvNBzIlhAx2xt6bmUvR4DxXGvm32TZDbAEoyAXSd4KUvX4iPy1MqmkAvP3VsWLmnJkrztWeB2Q==","signatures":[{"sig":"MEUCIQDgRQfrIuzAzTDQ34PVqazXybXfyY7jmHymGyHQ54ZG7gIgCOuYU8yykVZyJeu/EEpgT59UircBW8dFpTgiQsUdSaI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74296},"main":"dist/index.mjs","type":"module","_from":"file:alloc-redis-on-workers-0.4.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"tsx --test","build":"tsup"},"typings":"dist/index.d.ts","_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/ec8f5f31b522b3d7c1b96f94f8c4cc2b/alloc-redis-on-workers-0.4.0.tgz","_integrity":"sha512-HPziN7VkyXlzmvNBzIlhAx2xt6bmUvR4DxXGvm32TZDbAEoyAXSd4KUvX4iPy1MqmkAvP3VsWLmnJkrztWeB2Q==","repository":{"url":"git+https://github.com/alloc/redis-on-workers.git","type":"git"},"_npmVersion":"10.9.2","description":"Connect to your Redis server using cloudflare:sockets","directories":{},"_nodeVersion":"23.7.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","tsup":"^8.3.0","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.5","@sinclair/typebox":"^0.34.21","@cloudflare/workers-types":"^4.20241011.0","prettier-plugin-organize-imports":"^4.1.0"},"peerDependencies":{"@sinclair/typebox":"*","@arrowood.dev/socket":"^0.2.0"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/redis-on-workers_0.4.0_1739480106682_0.5382756046382722","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@alloc/redis-on-workers","version":"0.5.0","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"license":"MIT","_id":"@alloc/redis-on-workers@0.5.0","maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"contributors":[{"name":"Kane Wang"}],"homepage":"https://github.com/alloc/redis-on-workers#readme","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"dist":{"shasum":"368e3d0540844f6075658d285df6b9a54718c71f","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.5.0.tgz","fileCount":7,"integrity":"sha512-NPOUfMbjAkDyr1Ad6QbUpKr3OpK+4qRmRuzs+1H75Fa7abJZ6bMkzt3jdMUoMkXhranypwwQxjo9iuWHW9EwKA==","signatures":[{"sig":"MEUCIQDYCmd5OqW/cimrvYFKdI6aYNgMxaNPipiG2wJhbQhh0gIgYZkOr5BJ2+saZ05GgBC6E/P7n6fjRUnhzh3iq4Yy/h0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94264},"main":"dist/index.mjs","type":"module","_from":"file:alloc-redis-on-workers-0.5.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"tsx --test","build":"tsup"},"typings":"dist/index.d.ts","_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/c92e6257d54ca1c32a090d22ab93c9c3/alloc-redis-on-workers-0.5.0.tgz","_integrity":"sha512-NPOUfMbjAkDyr1Ad6QbUpKr3OpK+4qRmRuzs+1H75Fa7abJZ6bMkzt3jdMUoMkXhranypwwQxjo9iuWHW9EwKA==","repository":{"url":"git+https://github.com/alloc/redis-on-workers.git","type":"git"},"_npmVersion":"10.9.2","description":"Connect to your Redis server using cloudflare:sockets","directories":{},"_nodeVersion":"23.7.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","tsup":"^8.3.0","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.5","@sinclair/typebox":"^0.34.21","@cloudflare/workers-types":"^4.20241011.0","prettier-plugin-organize-imports":"^4.1.0"},"peerDependencies":{"@sinclair/typebox":"*","@arrowood.dev/socket":"^0.2.0"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/redis-on-workers_0.5.0_1739981666128_0.6661280867177546","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@alloc/redis-on-workers","version":"0.6.0","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"license":"MIT","_id":"@alloc/redis-on-workers@0.6.0","maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"contributors":[{"name":"Kane Wang"}],"homepage":"https://github.com/alloc/redis-on-workers#readme","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"dist":{"shasum":"68a4388b12bc7f5d621078388d79525ed374dd74","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.6.0.tgz","fileCount":7,"integrity":"sha512-gcCE3sL646cF5J+qyWcJGlIm6f93z/dJeJaiSMo5LfBcYITAONo7d2XAefGKUFwuxEV6ZXxF8xVSZNvnCcuROg==","signatures":[{"sig":"MEUCIEelv57rmTtNSdsZT6/WGi6/458IE2dyXItjnBsOibKQAiEA9izYgU0yoOdF3ncn/IC6CaFktuMVvtTNoCKVfXrdeiM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132660},"main":"dist/index.mjs","type":"module","_from":"file:alloc-redis-on-workers-0.6.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup"},"typings":"dist/index.d.ts","_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/b2cbd9de11d3aeaef92b76d54743b2bb/alloc-redis-on-workers-0.6.0.tgz","_integrity":"sha512-gcCE3sL646cF5J+qyWcJGlIm6f93z/dJeJaiSMo5LfBcYITAONo7d2XAefGKUFwuxEV6ZXxF8xVSZNvnCcuROg==","repository":{"url":"git+https://github.com/alloc/redis-on-workers.git","type":"git"},"_npmVersion":"10.9.2","description":"Connect to your Redis server using cloudflare:sockets","directories":{},"_nodeVersion":"23.7.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","tsup":"^8.3.0","vitest":"^3.0.6","radashi":"13.0.0-beta.ffa4778","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.5","@sinclair/typebox":"^0.34.21","@arrowood.dev/socket":"0.2.0","@cloudflare/workers-types":"^4.20241011.0","prettier-plugin-organize-imports":"^4.1.0"},"peerDependencies":{"@sinclair/typebox":"*","@arrowood.dev/socket":">=0.2.0"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/redis-on-workers_0.6.0_1740927943997_0.9218070465788102","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@alloc/redis-on-workers","version":"0.6.1","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"license":"MIT","_id":"@alloc/redis-on-workers@0.6.1","maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"contributors":[{"name":"Kane Wang"}],"homepage":"https://github.com/alloc/redis-on-workers#readme","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"dist":{"shasum":"8fe7726f3371cc78122d82b3d660e700b645d417","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.6.1.tgz","fileCount":7,"integrity":"sha512-xDmTaFtG1CYAQtR4K0OgIeAN4seewT7bVVmqk4KHbN1BknUazIYcjkRMhgboayyYh7kCurUPGImrGVIXpvrpFw==","signatures":[{"sig":"MEYCIQCE+HAfQiiZp9DSqR1DuVFnzJO5sW75d0Ju6HRC7tYBaQIhAIX5OVSrbsWgFf6RBqFyYckSUnyZviAZMWkDuOtTjgqM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132660},"main":"dist/index.mjs","type":"module","_from":"file:alloc-redis-on-workers-0.6.1.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup"},"typings":"dist/index.d.ts","_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/8f17437c107473b80d6a6e92768614ba/alloc-redis-on-workers-0.6.1.tgz","_integrity":"sha512-xDmTaFtG1CYAQtR4K0OgIeAN4seewT7bVVmqk4KHbN1BknUazIYcjkRMhgboayyYh7kCurUPGImrGVIXpvrpFw==","repository":{"url":"git+https://github.com/alloc/redis-on-workers.git","type":"git"},"_npmVersion":"10.9.2","description":"Connect to your Redis server using cloudflare:sockets","directories":{},"_nodeVersion":"23.7.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","tsup":"^8.3.0","vitest":"^3.0.6","radashi":"13.0.0-beta.ffa4778","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.5","@sinclair/typebox":"^0.34.21","@arrowood.dev/socket":"0.2.0","@cloudflare/workers-types":"^4.20241011.0","prettier-plugin-organize-imports":"^4.1.0"},"peerDependencies":{"@sinclair/typebox":"*","@arrowood.dev/socket":">=0.2.0"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/redis-on-workers_0.6.1_1742347872619_0.09789312137033801","host":"s3://npm-registry-packages-npm-production"}},"0.6.2":{"name":"@alloc/redis-on-workers","version":"0.6.2","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"license":"MIT","_id":"@alloc/redis-on-workers@0.6.2","maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"contributors":[{"name":"Kane Wang"}],"homepage":"https://github.com/alloc/redis-on-workers#readme","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"dist":{"shasum":"81e7c2f6edefb20f94430f59db7aa82ae465fb87","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.6.2.tgz","fileCount":7,"integrity":"sha512-9EchcyaxzWe6Pyk7OPpYJHRP+jLLsHbjsR9V5ptw4k3nEGGEY4+QMUWX2g5PCt7oDIa1YMWStfM+th7IvJVYTg==","signatures":[{"sig":"MEUCIBpuU2LBezkXPcOF1mgK2y8L8dXWKL8aovHdAhsCydOOAiEAuM9zSQcF2IpCvVwryZUCcRLAS8tFHXvjIwJBV3azgTU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133072},"main":"dist/index.mjs","type":"module","_from":"file:alloc-redis-on-workers-0.6.2.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup"},"typings":"dist/index.d.ts","_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/c78614fdfef9adcc6618cb60c6f1b55b/alloc-redis-on-workers-0.6.2.tgz","_integrity":"sha512-9EchcyaxzWe6Pyk7OPpYJHRP+jLLsHbjsR9V5ptw4k3nEGGEY4+QMUWX2g5PCt7oDIa1YMWStfM+th7IvJVYTg==","repository":{"url":"git+https://github.com/alloc/redis-on-workers.git","type":"git"},"_npmVersion":"10.9.2","description":"Connect to your Redis server using cloudflare:sockets","directories":{},"_nodeVersion":"23.7.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","tsup":"^8.3.0","vitest":"^3.0.6","radashi":"13.0.0-beta.ffa4778","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.5","@sinclair/typebox":"^0.34.21","@arrowood.dev/socket":"0.2.0","@cloudflare/workers-types":"^4.20241011.0","prettier-plugin-organize-imports":"^4.1.0"},"peerDependencies":{"@sinclair/typebox":"*","@arrowood.dev/socket":">=0.2.0"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/redis-on-workers_0.6.2_1742349333267_0.2575851056216014","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@alloc/redis-on-workers","version":"0.7.0","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"license":"MIT","_id":"@alloc/redis-on-workers@0.7.0","maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"contributors":[{"name":"Kane Wang"}],"homepage":"https://github.com/alloc/redis-on-workers#readme","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"dist":{"shasum":"683fab52360c84ca52a291a829fda91b6124b226","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.7.0.tgz","fileCount":7,"integrity":"sha512-CC3/EZFC4LldL5KzzHHN07Y16yreaDb31f9/pIvVNApkbhi+HIkJQD4kLjXTTY+Dijl3TBwkq4XAmELcZFJZKw==","signatures":[{"sig":"MEUCIFrv618DTl2yxXdnpcANpzmRzSZdEpm8gAk7BoN9FtmYAiEA7BztmXQ9yqWkMydW8dhnhEFLEq1Wna2AE2GySGNQ37E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":164087},"main":"dist/index.mjs","type":"module","_from":"file:alloc-redis-on-workers-0.7.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --clean --watch --sourcemap","lint":"tsc-lint","test":"vitest","build":"tsup --clean"},"typings":"dist/index.d.ts","_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/9358c471632ebf17db76091b6df5ae1d/alloc-redis-on-workers-0.7.0.tgz","_integrity":"sha512-CC3/EZFC4LldL5KzzHHN07Y16yreaDb31f9/pIvVNApkbhi+HIkJQD4kLjXTTY+Dijl3TBwkq4XAmELcZFJZKw==","repository":{"url":"git+https://github.com/alloc/redis-on-workers.git","type":"git"},"_npmVersion":"10.9.2","description":"Connect to your Redis server using cloudflare:sockets","directories":{},"sideEffects":false,"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","tsup":"^8.3.0","vitest":"^3.0.6","radashi":"13.0.0-beta.ffa4778","prettier":"^3.3.3","tsc-lint":"^0.1.9","typescript":"^5.6.3","@types/node":"^22.7.5","@sinclair/typebox":"^0.34.21","@arrowood.dev/socket":"0.2.0","@cloudflare/workers-types":"^4.20241011.0","prettier-plugin-organize-imports":"^4.1.0"},"peerDependencies":{"@sinclair/typebox":"*","@arrowood.dev/socket":">=0.2.0"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/redis-on-workers_0.7.0_1745882899877_0.7781658583419027","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@alloc/redis-on-workers","version":"0.8.0","description":"Connect to your Redis server using cloudflare:sockets","sideEffects":false,"main":"dist/index.mjs","typings":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"author":{"name":"Alec Larson"},"contributors":[{"name":"Kane Wang"}],"repository":{"type":"git","url":"git+https://github.com/alloc/redis-on-workers.git"},"type":"module","license":"MIT","peerDependencies":{"@arrowood.dev/socket":">=0.2.0","@sinclair/typebox":"*"},"peerDependenciesMeta":{"@arrowood.dev/socket":{"optional":true}},"devDependencies":{"@arrowood.dev/socket":"0.2.0","@cloudflare/workers-types":"^4.20241011.0","@sinclair/typebox":"^0.34.21","@types/node":"^22.7.5","prettier":"^3.3.3","prettier-plugin-organize-imports":"^4.1.0","radashi":"13.0.0-beta.ffa4778","tsc-lint":"^0.1.9","tsup":"^8.3.0","tsx":"^4.19.1","typescript":"^5.6.3","vitest":"^3.0.6"},"scripts":{"dev":"tsup --clean --watch --sourcemap","build":"tsup --clean","test":"vitest","lint":"tsc-lint"},"_id":"@alloc/redis-on-workers@0.8.0","bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"homepage":"https://github.com/alloc/redis-on-workers#readme","_integrity":"sha512-vWLpfCe1Lyz/gAFN3dMyk8v1lSNa3zeO7QE+8t0C7ap/dCuQu5l394oeRKfJzgxU6oMNIBzzYMeRtPWNGxs1cQ==","_resolved":"/private/var/folders/4l/lb2f5pj1221bm7d89gh08fx80000gn/T/a415afbfb61be774903e70d41ee38d5b/alloc-redis-on-workers-0.8.0.tgz","_from":"file:alloc-redis-on-workers-0.8.0.tgz","_nodeVersion":"23.6.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-vWLpfCe1Lyz/gAFN3dMyk8v1lSNa3zeO7QE+8t0C7ap/dCuQu5l394oeRKfJzgxU6oMNIBzzYMeRtPWNGxs1cQ==","shasum":"9372ad9ffcc2cc8d8e69e63dfd951647fb16f666","tarball":"https://registry.npmjs.org/@alloc/redis-on-workers/-/redis-on-workers-0.8.0.tgz","fileCount":7,"unpackedSize":158123,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC7Y5N24y2hHbxpq0GFbo+lw61C5W9KabyAsj7H6C5VugIhANbHo6zYT60qffKB4vWPWdJcycKNKvmzGuaZ+X9NyJ8+"}]},"_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"directories":{},"maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/redis-on-workers_0.8.0_1746638724379_0.3730396190641352"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-13T20:55:06.588Z","modified":"2025-05-07T17:25:24.763Z","0.4.0":"2025-02-13T20:55:06.903Z","0.5.0":"2025-02-19T16:14:26.311Z","0.6.0":"2025-03-02T15:05:44.199Z","0.6.1":"2025-03-19T01:31:12.797Z","0.6.2":"2025-03-19T01:55:33.426Z","0.7.0":"2025-04-28T23:28:20.043Z","0.8.0":"2025-05-07T17:25:24.556Z"},"bugs":{"url":"https://github.com/alloc/redis-on-workers/issues"},"author":{"name":"Alec Larson"},"license":"MIT","homepage":"https://github.com/alloc/redis-on-workers#readme","keywords":["redis","cloudflare","workers","typescript","socket","tcp","typebox"],"repository":{"type":"git","url":"git+https://github.com/alloc/redis-on-workers.git"},"description":"Connect to your Redis server using cloudflare:sockets","contributors":[{"name":"Kane Wang"}],"maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"readme":"# @alloc/redis-on-workers\n\nConnect to your Redis server using `cloudflare:sockets`.\n\nThis package is designed to work with Cloudflare Workers, but it can also be used in node.js thanks to the implementation of [`cloudflare:sockets` for node.js](https://github.com/Ethan-Arrowood/socket).\n\n> [!NOTE]\n> This is a fork of [redis-on-workers](https://github.com/kane50613/redis-on-workers) with some improvements:\n>\n> - Modular commands and key types for tree-shakeable type safety.\n> - Integrated with `@sinclair/typebox` for static type-checking and runtime validation.\n> - Supports pub-sub with `subscribe` method, including pattern matching, keyspace notifications, and keyevent notifications.\n\n## Installation\n\n```sh\npnpm add @alloc/redis-on-workers\n```\n\n## Usage\n\n### Minimal\n\nThis is the minimal example to connect to a Redis server.\n\n```ts\nimport { RedisClient, RedisKey, GET, SET } from \"@alloc/redis-on-workers\";\nimport { Type } from \"@sinclair/typebox\";\n\nconst redis = new RedisClient({\n  url: \"redis://<username>:<password>@<host>:<port>\",\n});\nconst key = new RedisKey(\"foo\", Type.String());\n\nawait redis.send(SET(key, \"bar\"));\n\nconst value = await redis.send(GET(key));\n\nconsole.log(value); // bar\n\n// remember to close the connection after use, or use `redis.sendOnce`.\nawait redis.close();\n```\n\n### Raw Uint8Array\n\nThis is useful if you want to store binary data. For example, you can store protobuf messages in Redis.\n\n```ts\nimport { RedisClient } from \"@alloc/redis-on-workers\";\n\nconst redis = new RedisClient({\n  url: \"redis://<username>:<password>@<host>:<port>\",\n});\n\nawait redis.sendRaw(\"SET\", \"foo\", \"bar\");\n\nconst value = await redis.sendRawOnce(\"GET\", \"foo\");\n\nconst decoder = new TextDecoder();\n\nconsole.log(decoder.decode(value)); // bar\n```\n\n### Node.js\n\nPlease install the node.js polyfill for `cloudflare:sockets` to use this package in node.js.\n\n```sh\npnpm add @arrowood.dev/socket\n```\n\n## API\n\n### `new RedisClient(options: RedisClientOptions)`\n\nCreate a new Redis client, does NOT connect to the server yet, the connection will be established when the first command is sent.\n\nOr you can start connection immediately by using `redis.startConnection()`.\n\n### `RedisClientOptions`\n\n- `url` (string): The URL of the Redis server.\n- `tls` (boolean): Whether to use TLS. Default: `false`.\n- `connectFn` (function): Polyfill for `cloudflare:sockets`'s `connect` function if you're using it in node.js. Default: `undefined`.\n- `onReply` (function): Callback for Redis replies. Default: `undefined`.\n\n## Commands\n\nIt's relatively straight-forward to add more commands (see [here](https://github.com/alloc/redis-on-workers/blob/master/src/commands.ts) for examples). If one is missing that you need, please add it and submit a PR.\n\n- `GET(key)`  \n  Get the value of a key.\n- `GETEX(key, ...modifiers)`  \n  Get the value of a key and optionally set its expiration.\n- `SET(key, value, ...modifiers)`  \n  Set the value of a key and optionally set its expiration.\n- `DEL(key, ...keys)`  \n  Delete a key or multiple keys.\n- `INCR(key)`  \n  Increment the value of a key by 1.\n- `DECR(key)`  \n  Decrement the value of a key by 1.\n- `INCRBY(key, amount)`  \n  Increment the value of a key by a specific amount.\n- `DECRBY(key, amount)`  \n  Decrement the value of a key by a specific amount.\n- `KEYS(pattern)`  \n  Get all keys that match the given pattern.\n- `HGET(key, field)`  \n  Get the value of a field in a hash.\n- `HSET(key, field, value)`  \n  Set the value of a field in a hash.\n- `HSET(key, values)`  \n  Set the values of multiple fields in a hash.\n- `PUBLISH(channel, message)`  \n  Publish a message to a channel.\n\n### Modifiers\n\n- `NX()`  \n  Only set the key if it does not already exist.\n- `XX()`  \n  Only set the key if it already exists.\n- `EX(seconds)`  \n  Set the expiration time of a key in seconds.\n- `PX(milliseconds)`  \n  Set the expiration time of a key in milliseconds.\n- `EXAT(timestamp)`  \n  Set the expiration time of a key at a specific Unix time.\n- `PXAT(timestamp)`  \n  Set the expiration time of a key at a specific Unix time in milliseconds.\n- `KEEPTTL()`  \n  Retain the time to live associated with the key.\n- `PERSIST()`  \n  Remove the time to live associated with the key.\n\n## Development\n\nTo run the tests, first install [Redis Stack](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/). If you don't use Homebrew, you need to update `redis.conf` in this repository to use the correct path to the `redisearch.so` binary.\n\n```sh\nbrew install redis-stack\n```\n\nThen start the Redis server from the root directory:\n\n```sh\nredis-stack-server redis.conf\n```\n\nThen run the tests. 🥳\n\n```sh\npnpm test\n```\n","readmeFilename":"README.md"}