{"id":16542437,"url":"https://github.com/tada5hi/redis-extension","last_synced_at":"2025-06-14T04:07:00.694Z","repository":{"id":37073566,"uuid":"441416806","full_name":"tada5hi/redis-extension","owner":"tada5hi","description":"This is an redis extension to manage singeltone client \u0026 cluster instances, cache \u0026 track entity identifiers in groups. ","archived":false,"fork":false,"pushed_at":"2025-04-17T20:28:30.000Z","size":2678,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-05-01T08:47:46.049Z","etag":null,"topics":["client","cluster","singleton"],"latest_commit_sha":null,"homepage":"","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/tada5hi.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["tada5hi"]}},"created_at":"2021-12-24T08:56:43.000Z","updated_at":"2025-03-31T13:07:34.000Z","dependencies_parsed_at":"2024-05-03T21:31:21.822Z","dependency_job_id":"ee2d4c48-b18f-42e4-8bdc-45aa37dc1ddb","html_url":"https://github.com/tada5hi/redis-extension","commit_stats":{"total_commits":151,"total_committers":3,"mean_commits":"50.333333333333336","dds":0.4370860927152318,"last_synced_commit":"083bcb9e5e7a27a57f62c2cd3ce0ef22f844cb93"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fredis-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fredis-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fredis-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fredis-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tada5hi","download_url":"https://codeload.github.com/tada5hi/redis-extension/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fredis-extension/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":257992304,"owners_count":22633301,"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":["client","cluster","singleton"],"created_at":"2024-10-11T18:57:31.981Z","updated_at":"2025-06-14T04:07:00.669Z","avatar_url":"https://github.com/tada5hi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/tada5hi"],"categories":[],"sub_categories":[],"readme":"# Redis Extension 🍬\n\n[![npm version](https://badge.fury.io/js/redis-extension.svg)](https://badge.fury.io/js/redis-extension)\n[![main](https://github.com/tada5hi/redis-extension/actions/workflows/main.yml/badge.svg)](https://github.com/tada5hi/redis-extension/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/tada5hi/redis-extension/branch/master/graph/badge.svg?token=0VL41WO0CG)](https://codecov.io/gh/tada5hi/redis-extension)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\nThis a library, which provides additional [features](#features) to the\nredis client library.\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Features](#features)\n- [Usage](#usage)\n  - [Watcher](#watcher)\n  - [ScoreBoard](#scoreboard)\n  - [JsonAdapter](#jsonadapter)\n- [License](#license)\n\n## Installation\n\n```bash\nnpm install redis-extension --save\n```\n\n## Features\n\n- ️‍️🕵️‍♀️ **Watcher** - Watch for specific events\n- 🏆 **ScoreBoard** - Store keys by score.\n- 🔌 **JsonAdapter** - Stringify value as json string on set and parse on get\n\n## Usage\n\n### Watcher\n\n```typescript\nimport {\n    Watcher,\n    createClient\n} from \"redis-extension\";\n\nconst client = createClient();\nclient.set('foo', 'bar', 'PX', '500');\n\nconst watcher = new Watcher(client, {\n    pattern: 'foo*',\n});\n\n// Register events\nwatcher.on('expire', (key) =\u003e {\n    console.log(key);\n    // foo\n});\n\n// Start watching\nawait watcher.start();\n```\n\n### ScoreBoard\n\n```typescript\nimport {\n    createClient,\n    ScoreBoard,\n} from \"redis-extension\";\n\nconst client = createClient();\n\nconst scoreBoard = new ScoreBoard(client, {\n    key: 'users-online'\n});\n\n// add user with id: 1 to the stack (time: 1642423766)\nscoreBoard.add(1);\n\n// add user with id: 2 to the stack (time: 1642423866)\nscoreBoard.add(2);\n\nconst output = scoreBoard.get({\n    sort: 'DESC'\n});\n\nconsole.log(output);\n// {\n//      data: [\n//          {id: 1, score: 1642423766},\n//          {id: 2, score: 1642423866}\n//      ],\n//      meta: {\n//          total: 2\n//      }\n// }\n```\n\nThe `score` property represents the unix timestamp by default if it has not been set otherwise.\n\n### JsonAdapter\n\n```typescript\nimport {\n    JsonAdapter,\n    createClient\n} from \"redis-extension\";\n\nconst client = createClient();\n\nconst jsonAdapter = new JsonAdapter(client);\nawait jsonAdapter.set('51f3509d-871b-48ad-af15-d1c9eb941362', {\n    name: 'admin',\n    // ...\n});\nconst payload = jsonAdapter.get('51f3509d-871b-48ad-af15-d1c9eb941362');\nconsole.log(payload);\n// { name: 'admin', ... }\n```\n\n## License\n\nMade with 💚\n\nPublished under [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada5hi%2Fredis-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftada5hi%2Fredis-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada5hi%2Fredis-extension/lists"}