{"id":23819812,"url":"https://github.com/kth/kth-node-redis","last_synced_at":"2025-09-07T02:30:48.579Z","repository":{"id":38375722,"uuid":"67217733","full_name":"KTH/kth-node-redis","owner":"KTH","description":"Redis client module for Node.js. Everything with Promises!","archived":false,"fork":false,"pushed_at":"2024-12-01T04:14:39.000Z","size":449,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-12-06T16:43:25.366Z","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/KTH.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-02T11:39:38.000Z","updated_at":"2024-11-06T11:57:56.000Z","dependencies_parsed_at":"2024-11-06T12:34:28.072Z","dependency_job_id":"184d5f4e-6ca7-4de1-beea-04ac64257052","html_url":"https://github.com/KTH/kth-node-redis","commit_stats":{"total_commits":98,"total_committers":13,"mean_commits":7.538461538461538,"dds":0.7244897959183674,"last_synced_commit":"e3dcf6b90d1ee2d84ab6c2061bab17471ac50666"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/kth-node-redis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232163091,"owners_count":18481581,"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":"2025-01-02T07:15:50.489Z","updated_at":"2025-01-02T07:15:51.695Z","avatar_url":"https://github.com/KTH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kth-node-redis\n\nRedis client module for Node.js. (Everything with Promises)\n\n## Usage\n\n```javascript\nconst redis = require('kth-node-redis')\n\n// basics\nredis('default', {\n  /* optional redis client config */\n})\n  .then(function (client) {\n    return client.getAsync('key')\n  })\n  .then(function (value) {\n    // do something with value\n  })\n  .catch(function (err) {\n    // handle error\n  })\n\n// multi\nredis('default', {\n  /* optional redis client config */\n})\n  .then(function (client) {\n    return client.multi().hmset('foo', { value: 'bar' }).expire('foo', 30).hgetall('foo').execAsync()\n  })\n  .then(function (results) {\n    // results[1] =\u003e 'OK'\n    // results[1] =\u003e 1\n    // results[2] =\u003e { value: 'bar' }\n    // results will depend on what commands are executed\n  })\n  .catch(function (err) {\n    // handle error\n  })\n\n// quit if needed\nredis.quit('default')\n```\n\n## Options\n\n- `name` optional name, defaults to `default`. Use the same name to get\n  the same client instance or re-create it. Use a new name to create a\n  new instance.\n- `options` optional config for the Redis client. Has a default retry\n  strategy. See below for details. For info about the Redis client\n  options, see https://www.npmjs.com/package/redis.\n\n## Default retry strategy\n\n```js\nfunction retry_strategy(options) {\n  if (options.error.code === 'ECONNREFUSED') {\n    return new Error('Connection refused by server.')\n  }\n\n  if (options.total_retry_time \u003e 1000 * 60 * 60) {\n    return new Error('Retry time exhausted')\n  }\n\n  if (options.times_connected \u003e 10) {\n    return undefined\n  }\n\n  return Math.max(options.attempt * 100, 3000)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkth-node-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fkth-node-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkth-node-redis/lists"}