{"id":18862191,"url":"https://github.com/hapinessjs/redis-module","last_synced_at":"2026-02-09T22:30:20.572Z","repository":{"id":57115152,"uuid":"96995012","full_name":"hapinessjs/redis-module","owner":"hapinessjs","description":"Redis client module for Hapiness framework","archived":false,"fork":false,"pushed_at":"2019-01-03T09:19:14.000Z","size":150,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-30T23:35:24.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hapinessjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-12T10:22:27.000Z","updated_at":"2019-07-05T18:17:53.000Z","dependencies_parsed_at":"2022-08-22T10:40:06.619Z","dependency_job_id":null,"html_url":"https://github.com/hapinessjs/redis-module","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fredis-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fredis-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fredis-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fredis-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hapinessjs","download_url":"https://codeload.github.com/hapinessjs/redis-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239803168,"owners_count":19699624,"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-11-08T04:33:37.249Z","updated_at":"2026-02-09T22:30:20.514Z","avatar_url":"https://github.com/hapinessjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"http://bit.ly/2mxmKKI\" width=\"500\" alt=\"Hapiness\" /\u003e\n\n\u003cdiv style=\"margin-bottom:20px;\"\u003e\n\u003cdiv style=\"line-height:60px\"\u003e\n    \u003ca href=\"https://travis-ci.org/hapinessjs/redis-module.svg?branch=master\"\u003e\n        \u003cimg src=\"https://travis-ci.org/hapinessjs/redis-module.svg?branch=master\" alt=\"build\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://coveralls.io/github/hapinessjs/redis-module?branch=master\"\u003e\n        \u003cimg src=\"https://coveralls.io/repos/github/hapinessjs/redis-module/badge.svg?branch=master\" alt=\"coveralls\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/hapinessjs/redis-module\"\u003e\n        \u003cimg src=\"https://david-dm.org/hapinessjs/redis-module.svg\" alt=\"dependencies\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/hapinessjs/redis-module?type=dev\"\u003e\n        \u003cimg src=\"https://david-dm.org/hapinessjs/redis-module/dev-status.svg\" alt=\"devDependencies\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n    \u003ca href=\"https://www.typescriptlang.org/docs/tutorial.html\"\u003e\n        \u003cimg src=\"https://cdn-images-1.medium.com/max/800/1*8lKzkDJVWuVbqumysxMRYw.png\"\n             align=\"right\" alt=\"Typescript logo\" width=\"50\" height=\"50\" style=\"border:none;\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://reactivex.io/rxjs\"\u003e\n        \u003cimg src=\"http://reactivex.io/assets/Rx_Logo_S.png\"\n             align=\"right\" alt=\"ReactiveX logo\" width=\"50\" height=\"50\" style=\"border:none;\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://hapijs.com\"\u003e\n        \u003cimg src=\"http://bit.ly/2lYPYPw\"\n             align=\"right\" alt=\"Hapijs logo\" width=\"75\" style=\"border:none;\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n# Redis Module\n\n```Redis``` module for the Hapiness framework.\n\n## Table of contents\n\n\n* [Using your module inside Hapiness application](#using-your-module-inside-hapiness-application)\n\t* [`yarn` or `npm` it in your `package.json`](#yarn-or-npm-it-in-your-package)\n\t* [Importing `RedisModule` from the library](#importing-redismodule-from-the-library)\n\t* [Using `Redis` inside your application](#using-redis-inside-your-application)\n* [```RedisClientService``` functions](#redisclientservice-functions)\n\n## Using your module inside Hapiness application\n\n\n### `yarn` or `npm` it in your `package.json`\n\n```bash\n$ npm install --save @hapiness/core @hapiness/redis rxjs\n\nor\n\n$ yarn add @hapiness/core @hapiness/redis rxjs\n```\n\n```javascript\n\"dependencies\": {\n    \"@hapiness/core\": \"^1.3.0\",\n    \"@hapiness/redis\": \"^1.0.1\",\n    \"rxjs\": \"^5.5.5\",\n    //...\n}\n//...\n```\n\n\n### Importing `RedisModule` from the library\n\nThis module provide an Hapiness extension for Redis.\nTo use it, simply register it during the ```bootstrap``` step of your project and provide the ```RedisExt``` with its config\n\n```javascript\n\n@HapinessModule({\n    version: '1.0.0',\n    providers: [],\n    declarations: [],\n    imports: [RedisModule]\n})\nclass MyApp implements OnStart {\n    constructor() {}\n    onStart() {}\n}\n\nHapiness\n    .bootstrap(\n        MyApp,\n        [\n            /* ... */\n            RedisExt.setConfig(\n                {\n                    url: '//redis_url:6379',\n                    password: 'password',\n                    db: '1'\n                    /* ... Other options ... */\n                }\n            )\n        ]\n    )\n    .catch(err =\u003e {\n        /* ... */\n    });\n\n```\n\n```RedisExt``` needs a ```ClientOpts``` object so you can provide all the properties defined in the interface (see below)\n\n```\nexport interface ClientOpts {\n\n    host?: string;\n    port?: number;\n    path?: string;\n    url?: string;\n    parser?: string;\n    string_numbers?: boolean;\n    return_buffers?: boolean;\n    detect_buffers?: boolean;\n    socket_keepalive?: boolean;\n    no_ready_check?: boolean;\n    enable_offline_queue?: boolean;\n    retry_max_delay?: number;\n    connect_timeout?: number;\n    max_attempts?: number;\n    retry_unfulfilled_commands?: boolean;\n    auth_pass?: string;\n    password?: string;\n    db?: string;\n    family?: string;\n    rename_commands?: { [command: string]: string };\n    tls?: any;\n    prefix?: string;\n    retry_strategy?: RetryStrategy;\n    ping_keepalive_interval?: number: // In seconds\n}\n\n```\n\n\n### Using `Redis` inside your application\n\nTo use redis, you need to inject inside your providers the ```RedisClientService```.\n\n```javascript\n\nclass FooProvider {\n\n    constructor(private _redis: RedisClientService) {}\n\n    bar(): Observable\u003cstring\u003e {\n    \treturn this._redis.connection.get('my_key');\n    }\n\n}\n\n```\n\n\n## ```RedisClientService``` functions\n\n```RedisClientService.connection``` this will return you the redis client and you will be able to call on it every redis command (see the list of commands [here](https://redis.io/commands))\n\n**INFO** All function returns RxJS Observable\n\n[Back to top](#table-of-contents)\n\n## Maintainers\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"4\" align=\"center\"\u003e\u003ca href=\"https://www.tadaweb.com\"\u003e\u003cimg src=\"http://bit.ly/2xHQkTi\" width=\"117\" alt=\"tadaweb\" /\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Juneil\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6546204?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/antoinegomez\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/997028?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/reptilbud\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6841511?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/njl07\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/1673977?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Juneil\"\u003eJulien Fauville\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/antoinegomez\"\u003eAntoine Gomez\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/reptilbud\"\u003eSébastien Ritz\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/njl07\"\u003eNicolas Jessel\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n[Back to top](#table-of-contents)\n\n## License\n\nCopyright (c) 2017 **Hapiness** Licensed under the [MIT license](https://github.com/hapinessjs/redis-module/blob/master/LICENSE.md).\n\n[Back to top](#table-of-contents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhapinessjs%2Fredis-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhapinessjs%2Fredis-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhapinessjs%2Fredis-module/lists"}