{"id":16039519,"url":"https://github.com/salakjs/salak-redis","last_synced_at":"2026-04-26T23:31:38.758Z","repository":{"id":57153226,"uuid":"133623463","full_name":"SalakJS/salak-redis","owner":"SalakJS","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-01T09:16:04.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T05:42:06.909Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SalakJS.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":"2018-05-16T06:54:34.000Z","updated_at":"2018-06-01T09:16:05.000Z","dependencies_parsed_at":"2022-09-06T11:21:19.165Z","dependency_job_id":null,"html_url":"https://github.com/SalakJS/salak-redis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalakJS%2Fsalak-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalakJS%2Fsalak-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalakJS%2Fsalak-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalakJS%2Fsalak-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SalakJS","download_url":"https://codeload.github.com/SalakJS/salak-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294463,"owners_count":20915338,"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-08T23:05:09.570Z","updated_at":"2026-04-26T23:31:38.730Z","avatar_url":"https://github.com/SalakJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# salak-redis\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![David deps][david-image]][david-url]\n[![NPM download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/salak-redis.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/salak-redis\n[travis-image]: https://img.shields.io/travis/SalakJS/salak-redis.svg?style=flat-square\n[travis-url]: https://travis-ci.org/SalakJS/salak-redis\n[david-image]: https://img.shields.io/david/SalakJS/salak-redis.svg?style=flat-square\n[david-url]: https://david-dm.org/SalakJS/salak-redis\n[download-image]: https://img.shields.io/npm/dm/salak-redis.svg?style=flat-square\n[download-url]: https://npmjs.org/package/salak-redis\n\nRedis for SalakJS.\n\n## Install\n\n```sh\n$ npm install --save salak-redis\n```\n\n## Usage\n\n### Config\n\nIn middleware:\n\n```javascript\nmodule.exports = {\n  middleware: [\n    {\n      name: 'redis',\n      package: require('salak-redis')\n    }\n  ],\n  redis: {\n    host: '127.0.0.1',\n    port: 6379\n  }\n}\n```\n\noptions: ref to [redis](https://github.com/NodeRedis/node_redis#options-object-properties)\n\n### Use in Service or Controller\n\ncommon/service/user.js\n\n```javascript\nconst { Service } = require('salak')\n\nclass User extends Service {\n  async findUserInfo (uid) {\n    const info = await this.redis.getAsync(uid)\n    return info\n  }\n}\n\nmodule.exports = User\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalakjs%2Fsalak-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalakjs%2Fsalak-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalakjs%2Fsalak-redis/lists"}