{"id":16950025,"url":"https://github.com/jsumners/abstract-cache-redis","last_synced_at":"2025-08-09T10:31:53.320Z","repository":{"id":52921873,"uuid":"111845919","full_name":"jsumners/abstract-cache-redis","owner":"jsumners","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-13T22:37:11.000Z","size":18,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T09:06:18.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsumners.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-23T20:00:25.000Z","updated_at":"2024-08-20T11:35:34.000Z","dependencies_parsed_at":"2022-08-24T02:00:45.650Z","dependency_job_id":null,"html_url":"https://github.com/jsumners/abstract-cache-redis","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsumners%2Fabstract-cache-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsumners%2Fabstract-cache-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsumners%2Fabstract-cache-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsumners%2Fabstract-cache-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsumners","download_url":"https://codeload.github.com/jsumners/abstract-cache-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248477586,"owners_count":21110520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:56:38.975Z","updated_at":"2025-04-11T20:35:58.069Z","avatar_url":"https://github.com/jsumners.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# abstract-cache-redis\n\nThis module provides a cache client that is compliant with the\n[abstract-cache](https://github.com/jsumners/abstract-cache) protocol. This\nclient implements the `await` style of the protocol.\n\nIn addition to the API mandated by the protocol, the client exposes\n`keys`, `scan`, `scanStream`, `disconnect` and `quit` methods. These map to the\n[ioredis](https://npm.im/ioredis) methods of the same names. The `disconnect`\nand `quit` methods are only useful if you create the client with connection\nconfiguration instead of an already connected Redis client.\n\n## Example\n\n```js\n// Create a client that uses ioredis to connect to `localhost:6379`.\nconst client = require('abstract-cache-redis')({ioredis: {}})\n\nclient.set('foo', 'foo', 1000)\n  .then(() =\u003e client.has('foo'))\n  .then(console.log) // true\n  .then(() =\u003e client.quit())\n  .catch(console.error)\n\nclient.set('foo', 'foo', 1000)\n  .then(() =\u003e client.keys('fo*'))\n  .then(console.log) // [ 'foo' ]\n  .then(() =\u003e client.quit())\n  .catch(console.error)\n```\n\n## Options\n\nThe client factory accepts the an object with the following properties:\n\n+ `client`: An already connected instance of `ioredis`.\n+ `ioredis`: A regular `ioredis` configuration object.\n\nNotes:\n\n1. `client` takes precedence to `ioredis`.\n1. At least one of the `client` or `ioredis` properties must be supplied.\n1. The user is responsible for closing the connection.\n\n## Tests\n\nIn order to run the tests for this project a local instance of Reis must\nbe running on port `6379`. A `docker-compose.yml` is included to facilitate\nthis:\n\n```shell\n$ docker-compose -d up\n$ tap test/*.test.js\n```\n\n`npm test` automates the above.\n\n## License\n\n[MIT License](http://jsumners.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsumners%2Fabstract-cache-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsumners%2Fabstract-cache-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsumners%2Fabstract-cache-redis/lists"}