{"_id":"r-cache","_rev":"3-1cdc22a3df74db0097893fcdf4276c3d","name":"r-cache","description":"Minimalist cache function for redis","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"r-cache","version":"0.1.0","description":"Minimalist cache function for redis","main":"index.js","repository":{"type":"git","url":"git+https://github.com/nerdify/redis-cache.git"},"keywords":["redis","cache","promise","promises"],"author":{"name":"Hosmel Quintana","email":"hosmelq@gmail.com","url":"http://hosmelq.com"},"license":"MIT","bugs":{"url":"https://github.com/nerdify/redis-cache/issues"},"homepage":"https://github.com/nerdify/redis-cache#readme","dependencies":{"redis":"^2.7.1"},"devDependencies":{"eslint-config-prettier":"^2.1.1","prettier":"^1.4.2","xo":"^0.18.2"},"xo":{"extends":"prettier"},"gitHead":"dee9e77bf8762c937bbaede3e99d2753bf6c8bec","_id":"r-cache@0.1.0","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"hosmelq","email":"hosmelq@gmail.com"},"dist":{"integrity":"sha512-0zFsRQgcLfBcqM8hTwiYeX+6V+qa6bhBrmbbUDx4SyVjGrlIIXzQo2Al1zTOzbscpGwKnOhOJBfq/9fWwIXxBw==","shasum":"58f06ddcbe32e0dab7c3130f092abee0c9510fef","tarball":"https://registry.npmjs.org/r-cache/-/r-cache-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsth5cVlqFtiDefdpnGGqj9hi44325a6iT3kUqsRH/3gIhAIkIMA/Xf/eksOavBPI1KeER3CsrptVPoYLUgQMNu6vn"}]},"maintainers":[{"name":"hosmelq","email":"hosmelq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/r-cache-0.1.0.tgz_1496912195510_0.039748999988660216"}},"0.1.1":{"name":"r-cache","version":"0.1.1","description":"Minimalist cache function for redis","main":"index.js","repository":{"type":"git","url":"git+https://github.com/nerdify/redis-cache.git"},"keywords":["redis","cache","promise","promises"],"author":{"name":"Hosmel Quintana","email":"hosmelq@gmail.com","url":"http://hosmelq.com"},"license":"MIT","bugs":{"url":"https://github.com/nerdify/redis-cache/issues"},"homepage":"https://github.com/nerdify/redis-cache#readme","dependencies":{"redis":"^2.7.1"},"devDependencies":{"eslint-config-prettier":"^2.1.1","prettier":"^1.4.2","xo":"^0.18.2"},"xo":{"extends":"prettier"},"gitHead":"b92cd5f1183bf0102992f9ca508255a797f2a373","_id":"r-cache@0.1.1","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"hosmelq","email":"hosmelq@gmail.com"},"dist":{"integrity":"sha512-6+0hQCd31TGi/iRf7bFIwP0bVm274aDdHIMvbDrjnrht5JnhsdnVNIRFYp0nv6Y6zE/HAnO0cnfuF5Xg+GzSaQ==","shasum":"736bf07e0d72dfb4890d3bde00cd02c5fc86e653","tarball":"https://registry.npmjs.org/r-cache/-/r-cache-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqNtyo6Dg3mB7NXjjk9ymwXKC5LLrr8z2ISTNlwUBcUgIgQeub1hWu9S2AL6fo2Jl6TcaYyUm1YrjlNTJc9olHBIE="}]},"maintainers":[{"name":"hosmelq","email":"hosmelq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/r-cache-0.1.1.tgz_1496915641032_0.3958412646315992"}},"0.2.0":{"name":"r-cache","version":"0.2.0","description":"Minimalist cache function for redis","main":"index.js","repository":{"type":"git","url":"git+https://github.com/nerdify/redis-cache.git"},"keywords":["redis","cache","promise","promises"],"author":{"name":"Hosmel Quintana","email":"hosmelq@gmail.com","url":"http://hosmelq.com"},"license":"MIT","bugs":{"url":"https://github.com/nerdify/redis-cache/issues"},"homepage":"https://github.com/nerdify/redis-cache#readme","dependencies":{"redis":"2.7.1"},"devDependencies":{"xo":"^0.18.2"},"gitHead":"449c1d6b3d51bb3dc0711b99fa10c032e5b4c27d","_id":"r-cache@0.2.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"hosmelq","email":"hosmelq@gmail.com"},"dist":{"integrity":"sha512-aYvmnji5oWHpZM9vXkgMAJzrYIOMiznbSIAyUoVQtM8qoOBYpeyK2mf2MJ4tFv0sq1lkqoNCdJE7mYWdDoHXFw==","shasum":"4ddbe666e6730d9de62bf89f0c8bcaa81ffeea1f","tarball":"https://registry.npmjs.org/r-cache/-/r-cache-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc0JhoV+9sOBpKHQg/VfNogbmEffFRh/0eCtZeJrGu4wIhAPrZgiMAh2cwRbLh4QkfD6faxaPL+k6DNDobvSy/OwfT"}]},"maintainers":[{"name":"hosmelq","email":"hosmelq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/r-cache-0.2.0.tgz_1501786705203_0.7154957877937704"}}},"readme":"# r-cache\n\n> Minimalist cache function for redis\n\nSometimes you may wish to retrieve an item from the cache, but also store a default value if the requested item doesn't exist.\n\n[node_redis](https://github.com/NodeRedis/node_redis) is used for connections.\n\n## Install\n\n```\n$ npm install --save r-cache\n```\n\n## Usage\n\n```js\nconst rCache = require('r-cache');\n\nconst client = rCache.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST);\n\nconst text = rCache.cache('text', 60, () => {\n  return 'Lorem ipsum dolor sit amet ...';\n});\n```\n\n## API\n\n### cache\n\nReturns the item in the cache for the given key, if the item does not exist in the cache, the function passed will be executed and its result will be placed in the cache.\n\n#### key\n\nThe key for store the item in the cache.\n\nType: `string`\n\n#### seconds\n\nNumber of seconds for which the value should be cached.\n\nTypes: `number`\n\n#### fn\n\nThe function to be executed.\n\nType: `Function`\n\n### createClient\n\nSame options as [`node_redis#rediscreateclient`](https://github.com/NodeRedis/node_redis#rediscreateclient). This returns the `redis` client.\n\n## License\n\nMIT © [Hosmel Quintana](https://hosmelq.com)\n","maintainers":[{"name":"hosmelq","email":"hosmelq@gmail.com"}],"time":{"modified":"2022-05-14T00:05:03.087Z","created":"2017-06-08T08:56:36.578Z","0.1.0":"2017-06-08T08:56:36.578Z","0.1.1":"2017-06-08T09:54:01.978Z","0.2.0":"2017-08-03T18:58:26.187Z"},"homepage":"https://github.com/nerdify/redis-cache#readme","keywords":["redis","cache","promise","promises"],"repository":{"type":"git","url":"git+https://github.com/nerdify/redis-cache.git"},"author":{"name":"Hosmel Quintana","email":"hosmelq@gmail.com","url":"http://hosmelq.com"},"bugs":{"url":"https://github.com/nerdify/redis-cache/issues"},"license":"MIT","readmeFilename":"README.md"}