{"id":20199913,"url":"https://github.com/fortunejs/fortune-redis","last_synced_at":"2025-10-14T04:06:35.551Z","repository":{"id":57241054,"uuid":"44970689","full_name":"fortunejs/fortune-redis","owner":"fortunejs","description":"This is a Redis adapter for Fortune.","archived":false,"fork":false,"pushed_at":"2017-01-21T22:37:11.000Z","size":29,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T17:27:42.822Z","etag":null,"topics":["data-access-layer","fortune","redis"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fortunejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-26T13:38:16.000Z","updated_at":"2017-06-27T03:15:46.000Z","dependencies_parsed_at":"2022-09-08T00:40:50.037Z","dependency_job_id":null,"html_url":"https://github.com/fortunejs/fortune-redis","commit_stats":null,"previous_names":["thibremy/fortune-redis"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fortunejs/fortune-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortunejs%2Ffortune-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortunejs%2Ffortune-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortunejs%2Ffortune-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortunejs%2Ffortune-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fortunejs","download_url":"https://codeload.github.com/fortunejs/fortune-redis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortunejs%2Ffortune-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017964,"owners_count":26086197,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["data-access-layer","fortune","redis"],"created_at":"2024-11-14T04:40:25.324Z","updated_at":"2025-10-14T04:06:35.532Z","avatar_url":"https://github.com/fortunejs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Code Climate](https://codeclimate.com/github/thibremy/fortune-redis/badges/gpa.svg)](https://codeclimate.com/github/thibremy/fortune-redis)\n\n# Fortune Redis Adapter\n\nThis is a [Redis](https://http://redis.io) adapter for [Fortune](http://fortune.js.org).\nThis package now use [ioredis](https://github.com/luin/ioredis) instead of [node_redis](https://github.com/NodeRedis/node_redis)\n\n## Usage\n\nInstall the `fortune-redis` package from `npm`:\n\n```git \n$ npm install fortune-redis\n```\n\nThen use it with Fortune:\n\n```js\nimport fortune from 'fortune'\nimport redisAdapter from 'fortune-redis'\n\nconst store = fortune({...},  {\n  adapter: [\n    redisAdapter,\n    {\n      url: 'redis://:authpassword@127.0.0.1:6380'\n    }\n  ]\n})\n```\n\n\n## Adapter Options\n\n\nEvent    | Description\n:------------- | :-------------\ngenerateId   | Generate the _id key on a new document. It must be a function that accepts one argument, the record type, and returns a unique string or number. Optional.\nreateClientFactory    | see below\n\n\nAny node.js redis client library that conforms (or when adapted) to [ioredis](https://github.com/luin/ioredis) API can be injected into fortune-redis. You should only provide a createClientFactory function as a redis connection factory instead of providing ioredis connection options.\n\nBelow is a sample code to use fortune-redis with [ioredis-mock](https://github.com/stipsan/ioredis-mock).\n\n```js\nimport fortune from 'fortune'\nimport redisAdapter from 'fortune-redis'\nimport RedisMock from 'ioredis-mock'\n\nconst store = fortune({...},  {\n  adapter: [\n    redisAdapter,\n    {\n      createClientFactory() {\n        return new RedisMock()\n      }\n    }\n  ]\n})\n```\n\n## License\n\nThis software is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortunejs%2Ffortune-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffortunejs%2Ffortune-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortunejs%2Ffortune-redis/lists"}