{"_id":"@142vip/redis","_rev":"6-32b32ae4fb83d23f2d92da3de8b713be","name":"@142vip/redis","dist-tags":{"latest":"0.0.1-alpha.5"},"versions":{"0.0.1-alpha.0":{"name":"@142vip/redis","version":"0.0.1-alpha.0","keywords":["公众号搜：储凡"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/redis@0.0.1-alpha.0","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"dist":{"shasum":"365d5e0e3df767d34ee13ff830f5ba011fd6bbcf","tarball":"https://registry.npmjs.org/@142vip/redis/-/redis-0.0.1-alpha.0.tgz","fileCount":14,"integrity":"sha512-TdTP8s5iIW+wEtdGBEDEs+xDM5LRL9D8RQwctv3Tci/mgcCOQKhNwIj/1qyO2eydMGiTUZGTPW3q73v9oUCN8w==","signatures":[{"sig":"MEYCIQCZlZuYjVqpJKHi58C5ZNGCsKEsUGMw5UrLfvd7+dSC2wIhAOGeQfTjlQ+Sd/0O3pD99gfptYFgmxQD8of+00axQXpe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4981},"_from":"file:142vip-redis-0.0.1-alpha.0.tgz","types":"./index.d.ts","private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/private/var/folders/93/44x7xwkd2vz0pdy1z9s29m4r0000gn/T/7b5d9a962cdf9c4666bd94480261f609/142vip-redis-0.0.1-alpha.0.tgz","_integrity":"sha512-TdTP8s5iIW+wEtdGBEDEs+xDM5LRL9D8RQwctv3Tci/mgcCOQKhNwIj/1qyO2eydMGiTUZGTPW3q73v9oUCN8w==","_npmVersion":"10.8.1","description":"公众号搜：储凡","directories":{},"_nodeVersion":"20.16.0","dependencies":{"ioredis":"^5.4.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/redis_0.0.1-alpha.0_1722504199967_0.6611491538249394","host":"s3://npm-registry-packages"}},"0.0.1-alpha.1":{"name":"@142vip/redis","version":"0.0.1-alpha.1","keywords":["公众号搜：储凡"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/redis@0.0.1-alpha.1","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://github.com/142vip/core-x/tree/main/packages/redis","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"43acb23fe1c54ff5463ade5571487c4d9f918ad7","tarball":"https://registry.npmjs.org/@142vip/redis/-/redis-0.0.1-alpha.1.tgz","fileCount":8,"integrity":"sha512-G7TzwyILgcx48heXPpv6PMc5ucj64EsBtEY+6sSgRsi1uscePeRw4lH7xl3Plf5XdLoEHByhGz95foqkAVIVmg==","signatures":[{"sig":"MEQCIBUbWUW2vBQWPY570yjXwNlzheIinUYf4+KugXA+mfDyAiBgJMrvhdy8l3JPlc90ruWV+di/TPTcgxsfu7/1ObbOWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4028},"main":"./dist/index.mjs","_from":"file:142vip-redis-0.0.1-alpha.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/81fa71f2e9deeed46c071e8364cfa39b/142vip-redis-0.0.1-alpha.1.tgz","_integrity":"sha512-G7TzwyILgcx48heXPpv6PMc5ucj64EsBtEY+6sSgRsi1uscePeRw4lH7xl3Plf5XdLoEHByhGz95foqkAVIVmg==","repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git"},"_npmVersion":"10.5.0","description":"公众号搜：储凡","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"ioredis":"^5.4.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/redis_0.0.1-alpha.1_1728058108051_0.7796990256734249","host":"s3://npm-registry-packages"}},"0.0.1-alpha.2":{"name":"@142vip/redis","version":"0.0.1-alpha.2","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/redis","redis"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/redis@0.0.1-alpha.2","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/redis/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"3ab0228de65dae60e6ebe6e76fa7ffc652b32b6a","tarball":"https://registry.npmjs.org/@142vip/redis/-/redis-0.0.1-alpha.2.tgz","fileCount":8,"integrity":"sha512-oaMz+jcUmHB9hInbgIhX2nPFFvq2u3bULDaI8+1Oy53k5We6dycgrTiOEbhficp9lzgufawgJ6xFHDyJkpkTAA==","signatures":[{"sig":"MEYCIQCZjj3AG9hZ/dTxtq9WLvI7wrjG9j13VvBEHxfs+qqX3QIhAKn/NB1Ytj3rwUDiF8yYY+aBGyuFScUj6KGX6yZgdhLg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3400},"main":"./dist/index.mjs","_from":"file:142vip-redis-0.0.1-alpha.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/157bb0a8c66679d9bee403e49781dfcd/142vip-redis-0.0.1-alpha.2.tgz","_integrity":"sha512-oaMz+jcUmHB9hInbgIhX2nPFFvq2u3bULDaI8+1Oy53k5We6dycgrTiOEbhficp9lzgufawgJ6xFHDyJkpkTAA==","repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.5.0","description":"公众号搜：储凡","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"ioredis":"^5.4.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/redis_0.0.1-alpha.2_1736164610606_0.27102447155851994","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.3":{"name":"@142vip/redis","version":"0.0.1-alpha.3","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/redis","redis"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/redis@0.0.1-alpha.3","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/redis/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"6860d3a770ccacaac7ccd80c4477908c1adcf62e","tarball":"https://registry.npmjs.org/@142vip/redis/-/redis-0.0.1-alpha.3.tgz","fileCount":8,"integrity":"sha512-5HtJkH9fbZFoIGemTVIIbhPSJ+PH++PcdCQOyP3fm1eEcWIumqwlcJYjEcKs6fsQCYleDsbaUUwrjGTbRgyEvA==","signatures":[{"sig":"MEQCIHhCCErwDY0NyzZspZ1ovTn/E/f61TiE3HgVrhVZO+EYAiAPi0Be//f+mEwrrbYJxS1TNca12WNAD/HFUUWIng3VAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6458},"main":"./dist/index.mjs","_from":"file:142vip-redis-0.0.1-alpha.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/0ffe51321b984788eb0719a2f271db03/142vip-redis-0.0.1-alpha.3.tgz","_integrity":"sha512-5HtJkH9fbZFoIGemTVIIbhPSJ+PH++PcdCQOyP3fm1eEcWIumqwlcJYjEcKs6fsQCYleDsbaUUwrjGTbRgyEvA==","repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.5.0","description":"公众号搜：储凡","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"ioredis":"^5.4.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/redis_0.0.1-alpha.3_1737375030280_0.3503634589829099","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.4":{"name":"@142vip/redis","version":"0.0.1-alpha.4","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/redis","redis"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/redis@0.0.1-alpha.4","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/redis/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"fbf445fff3b52643246cc9caaef4e973c63405f5","tarball":"https://registry.npmjs.org/@142vip/redis/-/redis-0.0.1-alpha.4.tgz","fileCount":8,"integrity":"sha512-IBlJaP7ySUesTarnbTUtoLnhhET/L1BD/OYyR8cATTKZyGn13iCaG+DOgPlD73KZByPLcliA4AT42OcfT7NdMA==","signatures":[{"sig":"MEQCIHisBQ+o+YZJ8hbwItBhwAnfQ+g1KGIvHWGi+q55IFpTAiAyuoXTfoByPZHfDCK8WLw2M4TFGyJPYFi1kEOLWCLAOw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9759},"main":"./dist/index.mjs","_from":"file:142vip-redis-0.0.1-alpha.4.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/2b983d5ed7f804c324f645f9d57fd53f/142vip-redis-0.0.1-alpha.4.tgz","_integrity":"sha512-IBlJaP7ySUesTarnbTUtoLnhhET/L1BD/OYyR8cATTKZyGn13iCaG+DOgPlD73KZByPLcliA4AT42OcfT7NdMA==","authorInfo":{"url":"https://github.com/142vip","name":"微信公众号：储凡","email":"fairy_vip@2925.com","homePage":"https://142vip.cn"},"repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.5.0","description":"Redis通用工具，基于ioredis的封装","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"ioredis":"5.6.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/redis_0.0.1-alpha.4_1762243100913_0.7075926331246782","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.5":{"name":"@142vip/redis","version":"0.0.1-alpha.5","private":false,"description":"Redis通用工具，基于ioredis的封装","author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/redis/","repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/redis"},"keywords":["公众号搜：储凡","142vip","@142vip","@142vip/redis","redis"],"sideEffects":false,"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./index.d.ts","authorInfo":{"name":"微信公众号：储凡","email":"fairy_vip@2925.com","url":"https://github.com/142vip","homePage":"https://142vip.cn"},"dependencies":{"ioredis":"5.6.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"_id":"@142vip/redis@0.0.1-alpha.5","_integrity":"sha512-kyRPLdHOEXKQspEoDLyDh5QZvmBiqnk6PmyZZDivASRi/X1+kHHRfTb0R4Zx3Gik9ZY0K8rgLM/JKRXEh5SR0Q==","_resolved":"/tmp/a3ef498976dfc1fed7832d7450ced2aa/142vip-redis-0.0.1-alpha.5.tgz","_from":"file:142vip-redis-0.0.1-alpha.5.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-kyRPLdHOEXKQspEoDLyDh5QZvmBiqnk6PmyZZDivASRi/X1+kHHRfTb0R4Zx3Gik9ZY0K8rgLM/JKRXEh5SR0Q==","shasum":"5ce734be688d18b84fa3611263b29e12ec50ff00","tarball":"https://registry.npmjs.org/@142vip/redis/-/redis-0.0.1-alpha.5.tgz","fileCount":8,"unpackedSize":9749,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCDnEeEULYxOCwr6AnD+d8aY0zJfOadSYS5O4cvxfbB1QIgKZI5qF3xnVFOvnPEOu6Vma/HWGfWNuH9Sd3/3VC4A4s="}]},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"directories":{},"maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/redis_0.0.1-alpha.5_1767605261695_0.9997222283841947"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-01T09:23:19.877Z","modified":"2026-01-05T09:27:42.086Z","0.0.1-alpha.0":"2024-08-01T09:23:20.137Z","0.0.1-alpha.1":"2024-10-04T16:08:28.271Z","0.0.1-alpha.2":"2025-01-06T11:56:50.779Z","0.0.1-alpha.3":"2025-01-20T12:10:30.475Z","0.0.1-alpha.4":"2025-11-04T07:58:21.097Z","0.0.1-alpha.5":"2026-01-05T09:27:41.844Z"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/redis/","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/redis","redis"],"repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/redis"},"description":"Redis通用工具，基于ioredis的封装","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"readme":"# @142vip/redis\n\n## 安装\n\n```shell\n# npm\nnpm install @142vip/redis\n# pnpm\npnpm i @142vip/redis\n```\n\n## 使用\n\n### 创建工厂类\n```typescript\nimport { RedisFactory } from '@142vip/redis'\n\n// 初始化工厂类实例\nconst redisFactory = new RedisFactory()\n```\n\n- `redisFactory.createClient()` ：创建客户端\n- `redisFactory.createCluster()` ：创建集群客户端\n- `redisFactory.getClient()` ：获取客户端\n\n## 配置\n\n### 简单&哨兵模式\n```typescript\n// 默认连接 127.0.0.1:6379\nredisFactory.getClient()\n// 连接 127.0.0.1:6380, db 4,使用密码 123456\nredisFactory.getClient({\n  url: 'redis://:123456@127.0.0.1:6380/4',\n})\n// 用户名、密码都可以通过 URI 传递。\nredisFactory.getClient({\n  url: 'redis://username:password@127.0.0.1:6380/4',\n})\nredisFactory.getClient({\n  port: 6379, // 端口\n  host: '127.0.0.1', // host主机地址\n  username: 'default', // 需要redis版本大于6\n  password: 'my-top-secret',\n  db: 0, // 默认0\n})\n```\n\n### 集群模式\n\n```typescript\nredisFactory.getClient({\n  clusterNodes: [\n    {\n      host: '127.0.0.1',\n      port: 6379,\n    },\n    {\n      host: '127.0.0.1',\n      port: 6380,\n    },\n  ],\n  // 可选\n  clusterOptions: {\n    // 集群模式下，每个节点的连接配置\n    redisOptions: {\n      username: 'default', // 需要redis版本大于6\n      password: 'my-top-secret',\n      db: 0, // 默认0\n    },\n  },\n})\n```\n\n## 最佳实践\n\n- [egg-redis](https://github.com/eggjs/egg-redis)\n- [@142vip/nest-redis](https://github.com/142vip/nest-redis)\n\n## 参考\n\n- [IORedis Npm](https://www.npmjs.com/package/redis)\n- [IORedis Github](https://github.com/luin/ioredis)\n- [IORedis 官网](https://redis.io/)\n\n## 证书\n\n[MIT](https://opensource.org/license/MIT)\n\nCopyright (c) 2019-present, @142vip 储凡\n\n**仅供学习参考，商业使用请保留作者版权信息，作者不保证也不承担任何软件的使用风险。**\n","readmeFilename":"README.md"}