{"_id":"@chengaoyuan/redis-cache","_rev":"4-b96acf7cf2091acefc4c58c803f6400b","name":"@chengaoyuan/redis-cache","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"@chengaoyuan/redis-cache","version":"1.0.0","description":"使用redis实现CacheProtocol","main":"dist/index.js","scripts":{"test":"mocha -r ts-register --recursive -R spec test/*.ts","build":"node del.js && tsc -d"},"repository":{"type":"git","url":"git+https://github.com/GithubCGY/redis-cache.git"},"keywords":["redis","cache"],"author":{"name":"chengaoyuan"},"license":"MIT","bugs":{"url":"https://github.com/GithubCGY/redis-cache/issues"},"homepage":"https://github.com/GithubCGY/redis-cache#readme","devDependencies":{"@types/mocha":"^5.2.5","@types/node":"^10.12.12","@types/redis":"^2.8.10","mocha":"^5.2.0","redis":"^2.8.0","ts-node":"^7.0.1","typescript":"^3.2.2"},"gitHead":"912472fb1189695ee5bf179e80989401ea462a95","_id":"@chengaoyuan/redis-cache@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"},"dist":{"integrity":"sha512-DKk3TEGpPp3YiaGyxZOd9UUjCgYq6dV0uVQ5YNN6MCSwiNduIl3qdIKMPn5lLioqgwWCib1WQtA68d9pFNat6Q==","shasum":"d268bd5cbc5f517590d96ebe13499b267fa66444","tarball":"https://registry.npmjs.org/@chengaoyuan/redis-cache/-/redis-cache-1.0.0.tgz","fileCount":9,"unpackedSize":9308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLDBjCRA9TVsSAnZWagAApuMP/A2p296Qie5TmYCAx6HH\n1G2xy2Sotx4sIy2Qg6tZoC/wMA5Fvq3HnN+UXflAgN/KYGvMlrR37odwto/G\npl3TUCow4nVAgIE3SH8CpIeulpAiBt04IBHUdbf5KVbVN7n+/XEZA6ioc4ac\npW9gdRYi3mzt4hJ5Krs7fGzoABU+hqPLf0RF4pLpmpuU73yEKZHmSR9Z1VAG\nqc+45TXoOsSL2andyviB+aeBwBSBbA37iHuo/WySrAfd8QZCiVLAGJ8T2+Kz\niTgPbh8FBRVTzX+zypwbLW/xYlC1TkkDAbzV/MiEH3E+eN4wP+FZfZFsneEd\nBJBa/qC/9Lvdh2I0f8vICrYd9x9TaymWQGmF6SdSQJqiP6CZiA2JTOTFd9Kb\nc/iDJ4wxA0sBLDcwXUEwEjVYyE0yh7s5+o/AHVec+08NRaeHSUPbKhYf1mIE\nVhqndsvQjC3jy/j5Hk7Z2GLaG0FJQ2wLHzFOmiT2a+gK7wdeiUlCr2i646DV\njWoqxKIZHY+uqqzze3FUfU7zP/SgcW6LEUI8adCJaeN8U82RjpeXT5KAqbtp\nrEAagEFPXxhlBPaSyuW48WxU5b/8/fx0q34/WoLtNhZhZyy4gVMnejnutcth\n8IGJLijOYvH9AbJd4d3gDfwzDBvqEJAiW1+94UxFHyP0UKsu+OJDl/GHB/dz\nVexS\r\n=/LQ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQfNuR1d4b0U3luu3L6vD/hQHnbjkx9Ka6SIt1jlUUYAiEAj8CTPyFKztXwymS/QLJ71O/pAF3eOP1YrqB4uds/+8s="}]},"maintainers":[{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redis-cache_1.0.0_1546399842725_0.5750829243012565"},"_hasShrinkwrap":false},"2.0.0":{"name":"@chengaoyuan/redis-cache","version":"2.0.0","description":"使用redis实现CacheProtocol","main":"dist/index.js","scripts":{"test":"mocha -r ts-register --recursive -R spec test/*.ts","build":"node del.js && tsc -d"},"repository":{"type":"git","url":"git+https://github.com/GithubCGY/redis-cache.git"},"keywords":["redis","cache"],"author":{"name":"chengaoyuan"},"license":"MIT","bugs":{"url":"https://github.com/GithubCGY/redis-cache/issues"},"homepage":"https://github.com/GithubCGY/redis-cache#readme","devDependencies":{"@types/mocha":"^5.2.5","@types/node":"^10.12.12","@types/redis":"^2.8.10","mocha":"^5.2.0","redis":"^2.8.0","ts-node":"^7.0.1","typescript":"^3.2.2"},"gitHead":"02f8bdd8beb6e36366deb1fc587dd4a77404187a","_id":"@chengaoyuan/redis-cache@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"},"dist":{"integrity":"sha512-hoTV1yro8MWVyAV+IsZEsqLkN08ODPL0Ov2FG2mgZLEZ3ml42gTpkA7Fzr185rEbAZrfqZ7x0o+JQ6mdJ3JPug==","shasum":"baeb869d671912d28ccebea0416ef4ff3a899acf","tarball":"https://registry.npmjs.org/@chengaoyuan/redis-cache/-/redis-cache-2.0.0.tgz","fileCount":9,"unpackedSize":12078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJck1i9CRA9TVsSAnZWagAANM4P/AkR+rvaN5p4nPDWkVqJ\nXUv7PD3SvrDqwIF68yGONerA00cl/F5YyahLSIpiIo0eO6AyNs/Kd6I/4C3F\nhULbXdLGzMle/Rde6BZACwq79lJdz2GXJp3NatGEPCT6VpDNhC+eAYSPlo+m\nvxjnmh4ZLvGzOrXbz58k3ve2yNbmd1VJzTtESdkz/JRNN66bHxiXubuxD5ew\nnqfVqU5hiY7q3UgaFAzHex/576V7VEyVJvfe4mptxIycmEzp1iSF5Bt1D7Ea\nqmSYgkUYD6KWC3EKKffN+SZsfNj2BswFJaE+vDPZybUA5fhbKMr1wC3Te85U\n0NOlbGl0n5/CeNSL3zDqgfJA6PLqRc9Ngn5JU/JzG0OMeBIqWPnrNNzxoP9X\nIs2agG/O0e1SxKNS349dnEfpBFOA65lG7K3MN5F9mroVVamDnFvhSvuLxM1h\nmzYbilWBSjZbWJznZtAgOSelCl4bDUmFZfsvfmyRemN7AeB9OL2er+4nyqmA\nL8ijTVFEGMMSv0l+vpTn6QKfsQJyCkIddpHHhJvthGKZ5uKusfgNLGRFaIsd\nEd+c21Eju/lYbvooqtXE/cNqYtoOQZC2Rp6X3OmQuMAStI9jV5+EkVv2+bIb\nz9MJgBRCR/7g2pR3cSXyxPVNKLajCEu7ZjoqzBJn7cfwAw6y9MlrGYWhrmp8\nHsK7\r\n=d8lw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGk00aDeVJ81zwTau4ztD1hbAGWsI47qtyw2mXl5OIVQIhAK+oRAGZsqzriKCcpwKur6ckC5kjQjtORKATX6kaWXYy"}]},"maintainers":[{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redis-cache_2.0.0_1553160381399_0.5706151053473527"},"_hasShrinkwrap":false},"2.0.1":{"name":"@chengaoyuan/redis-cache","version":"2.0.1","description":"使用redis实现CacheProtocol","main":"dist/index.js","scripts":{"test":"mocha -r ts-register --recursive -R spec test/*.ts","build":"node del.js && tsc -d"},"repository":{"type":"git","url":"git+https://github.com/GithubCGY/redis-cache.git"},"keywords":["redis","cache"],"author":{"name":"chengaoyuan"},"license":"MIT","bugs":{"url":"https://github.com/GithubCGY/redis-cache/issues"},"homepage":"https://github.com/GithubCGY/redis-cache#readme","devDependencies":{"@types/mocha":"^5.2.5","@types/node":"^10.12.12","@types/redis":"^2.8.10","mocha":"^5.2.0","redis":"^2.8.0","ts-node":"^7.0.1","typescript":"^3.2.2"},"gitHead":"9243034fa8f3a0b7b91f434445919645e4498269","_id":"@chengaoyuan/redis-cache@2.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"},"dist":{"integrity":"sha512-PTynrp+Cia0A6LC7Q4qVVqB+7ZpulW+BoR1tGEYlWd2lwj1/W0nOTAWJEQJpzBM2/12Kbca32+QKpfu93VXynw==","shasum":"488d1447d84e3d517c42122a37cec46ce33db62b","tarball":"https://registry.npmjs.org/@chengaoyuan/redis-cache/-/redis-cache-2.0.1.tgz","fileCount":9,"unpackedSize":12664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJck2IYCRA9TVsSAnZWagAA0SIP/0N9aNCmoQDiUqvTebwq\nszwiRmrgCpSSFBmbQk66M5H6qGr9be7HgEbSvHoqmItO9ev7LJKbS349KEIq\nWxrUpTlYHuEeXAcQT+1L8aiTO22e07FBSyP7UuFOZnI3IapUCXK53zl+TMdF\niYBIoLXCKrQCgZQXXQikpWvIrw/hze2UKwZJ4hCIwsVtEUwO+kFTWMkdUBXN\nwRLOdB9sJRaoTJ3miVbZQdP02ohAs+UOzX7RZrWQETp0sSDefyNkEFRLL5R3\ncL9j06Fi9D+GyrKYwKEk6Qrz93dF3FbjXtRT9fCsF1NUnOLeVSziWlULc5b7\no8j2idTd2QY0Kwcabrv4XAaqxx0vl2TxAtdVq5U+EHMWqTMmtyuqIQ7qAgJV\n9IuZSMUmITkIjypVj0N00eBi2Xqo1nuAUBqrpfpLmcOJgpx5cuEQnYAmY0di\nGA+yCF12CCi1i73xoBU6UtaewdJhAsrhLhcRKeXspwGbxOF5vZN94Fdkr466\nCBYkPlmnvlXk0kp3cgcKHFDEu8GDfefYMqPgDdcQW1NOYwnlW24SXQJ71oLf\nrhhk6xNcTwtmueQ0wgAXMXNH2MmRVa96Tcy6OVFmw8lgZC9XfC/mFIxEQjEL\nPKE+q64Hs99J1JdxJ7kqWiQvsg8p2Y4Km7NdmEIr9bhc/Vr4QvM5UeLgyqhF\n+ka5\r\n=vFkP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA1u0JL1fZd5M4E1IdT59EMYbYHbEUsNVX7X3fdC6MAlAiAVoOCG5HM+NVRy1wHwFLfOSv8IGCc1zgo29tqEcIFKkA=="}]},"maintainers":[{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redis-cache_2.0.1_1553162776184_0.07933154140619081"},"_hasShrinkwrap":false},"2.0.2":{"name":"@chengaoyuan/redis-cache","version":"2.0.2","description":"使用redis实现CacheProtocol","main":"dist/index.js","scripts":{"test":"mocha -r ts-register --recursive -R spec test/*.ts","build":"node del.js && tsc -d"},"repository":{"type":"git","url":"git+https://github.com/GithubCGY/redis-cache.git"},"keywords":["redis","cache"],"author":{"name":"chengaoyuan"},"license":"MIT","bugs":{"url":"https://github.com/GithubCGY/redis-cache/issues"},"homepage":"https://github.com/GithubCGY/redis-cache#readme","devDependencies":{"@types/mocha":"^5.2.5","@types/node":"^10.12.12","@types/redis":"^2.8.10","mocha":"^5.2.0","redis":"^2.8.0","ts-node":"^7.0.1","typescript":"^3.2.2"},"gitHead":"354ef07231afa3bdaf5f002bf01707b8c00d89d4","_id":"@chengaoyuan/redis-cache@2.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"},"dist":{"integrity":"sha512-ajvD8Ldr3sc88kxkLivHpM/shfb6EGC570SAYlzfhlj9So6RTHDjQXeE20vxyVKKFNIUFNPA7lIQ3am/1sB7Sw==","shasum":"6ae38eef489d3d75af398923608832acde90b05f","tarball":"https://registry.npmjs.org/@chengaoyuan/redis-cache/-/redis-cache-2.0.2.tgz","fileCount":9,"unpackedSize":14073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclEDPCRA9TVsSAnZWagAAu9EQAIyokVazkL2pwyUQ8c/Y\n56XHQnIRU9zPGJ5V6LIcLc5BJM9/tjQDLRn066d1RZMAnBz1sUAIX7Dk/au+\nvFz8Q8LnoULuNFeYDiyYML6PIGRe5ZFRIMNUNHKJ6RHT6kujC3+4wf2d8kq6\nUf10BzG7lfQzFD/i1R5doB7AZVvv0UOprijRKf00VNayINlikMmwZ9sHJW8h\nm4uQ26/FvxuDwsTDN+kur9z5qyUfp1UhtgvuSFGRzqjLX7SH9Zs/wIX4zqhk\nWUGBMPxWt1X1Wthpp6FJbtgMVsdgrd1v6aJnD0T5iYIz7i4LsyQXbdDqzHUR\nsOLdGKnleRDHqgC2Apnj1CwbiyVfVFyv/3Sbu9NJs2ytggz8o05VqeHJ/lfe\n2G1XQeyvx/wFPSjqJGKPJn92znnGNggSH+isvSjWT1JlX85UQzOeOAdOLrln\nrUcDmuKE/tB8JZUuxOjIveNUIFxvBgzEN6eJ3zNur6vW+7YghfRBknemTtc8\nLtFQgDeX/bbfm0D1Bg6iWYvD9y8lcTFGfIzwlVkuwXn7FrzkiooABPZ3QL70\nojNwKtLeKXNGQNpZigTKBJN8acWWYE68R1MTRgTwTYhnDX8UlCJrZhMPBJi/\nGKHCEUBUVFn46LMk8PvG6AOe12Q3j8m72RwTDfXx98gPFFL7gGRnxnGa7jCh\nPbP3\r\n=QkE2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWG5vw27d7D91a0ZHN/pkpQZszcNbB31eLp6qLDlwwrwIhAKkNra3AWlV8D2oftzzTGH6JV0ej/qkblPQing9cyRUI"}]},"maintainers":[{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redis-cache_2.0.2_1553219790804_0.9261193270468806"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-02T03:30:42.553Z","1.0.0":"2019-01-02T03:30:42.850Z","modified":"2022-04-04T22:38:55.442Z","2.0.0":"2019-03-21T09:26:21.545Z","2.0.1":"2019-03-21T10:06:16.295Z","2.0.2":"2019-03-22T01:56:30.933Z"},"maintainers":[{"name":"chengaoyuan","email":"chen.gaoyuan@qq.com"}],"description":"使用redis实现CacheProtocol","homepage":"https://github.com/GithubCGY/redis-cache#readme","keywords":["redis","cache"],"repository":{"type":"git","url":"git+https://github.com/GithubCGY/redis-cache.git"},"author":{"name":"chengaoyuan"},"bugs":{"url":"https://github.com/GithubCGY/redis-cache/issues"},"license":"MIT","readme":"# redis-cache\r\n\r\n[![npm version](https://badge.fury.io/js/%40chengaoyuan%2Fredis-cache.svg)](https://badge.fury.io/js/%40chengaoyuan%2Fredis-cache)\r\n[![install size](https://packagephobia.now.sh/badge?p=@chengaoyuan/redis-cache)](https://packagephobia.now.sh/result?p=@chengaoyuan/redis-cache)\r\n[![NPM Downloads](https://img.shields.io/npm/dm/@chengaoyuan/redis-cache.svg?style=flat)](https://npmcharts.com/compare/@chengaoyuan/redis-cache?minimal=true)\r\n\r\n## Installation\r\n\r\n    $ npm install @chengaoyuan/redis-cache\r\n\r\n## Usage\r\n\r\n```ts\r\nimport { RedisClient } from \"redis\";\r\nimport RedisCache from \"@chengaoyuan/redis-cache\";\r\nimport { CacheInit, Cacheable, CachePut, CacheEvict } from \"@chengaoyuan/cache\";\r\nCacheInit(\r\n    new RedisCache(\r\n        new RedisClient({\r\n            host: \"127.0.0.1\",\r\n            port: 6379,\r\n            password: \"password\",\r\n            db: 10\r\n        })\r\n    )\r\n);\r\n\r\nclass Test {\r\n    datas: { [key: string]: any };\r\n    constructor() {\r\n        this.datas = {};\r\n    }\r\n\r\n    @Cacheable({\r\n        cache: \"Test\",\r\n        key: \"id\",\r\n        expire: 30,\r\n        condition: \"id >= 10\"\r\n    })\r\n    async getData(id: number) {\r\n        return this.datas[id];\r\n    }\r\n\r\n    @CacheEvict({\r\n        cache: \"Test\",\r\n        key: \"id\"\r\n    })\r\n    async setData(id: number, data: any) {\r\n        this.datas[id] = data;\r\n    }\r\n\r\n    @CachePut({\r\n        cache: \"Test\",\r\n        key: \"id\",\r\n        expire: 30\r\n    })\r\n    async getDataEx(id: number) {\r\n        return this.datas[id];\r\n    }\r\n}\r\n\r\nconst t = new Test();\r\n(async function() {\r\n    console.log(await t.getData(10));\r\n    console.log(await t.getData(10));\r\n    t.setData(10, { id: 123, name: \"gg\" });\r\n    console.log(await t.getData(10));\r\n    console.log(await t.getData(10));\r\n    console.log(await t.getDataEx(10));\r\n})();\r\n```\r\n","readmeFilename":"README.md"}