{"id":23605801,"url":"https://github.com/nailyjs/nest-redlock","last_synced_at":"2025-08-03T14:39:15.581Z","repository":{"id":269613780,"uuid":"824430838","full_name":"nailyjs/nest-redlock","owner":"nailyjs","description":"🔒Redlock module for nest.js","archived":false,"fork":false,"pushed_at":"2024-07-05T06:13:23.000Z","size":148,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"v1","last_synced_at":"2025-01-10T20:04:46.432Z","etag":null,"topics":["nest-module","nestjs","redlock","redlock-redis"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nailyjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-05T05:59:13.000Z","updated_at":"2024-12-10T14:05:05.000Z","dependencies_parsed_at":"2024-12-24T20:37:49.256Z","dependency_job_id":"8bcb66df-89ed-4740-a02a-8203b36b2564","html_url":"https://github.com/nailyjs/nest-redlock","commit_stats":null,"previous_names":["nailyjs/nest-redlock"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nailyjs%2Fnest-redlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nailyjs%2Fnest-redlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nailyjs%2Fnest-redlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nailyjs%2Fnest-redlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nailyjs","download_url":"https://codeload.github.com/nailyjs/nest-redlock/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241070711,"owners_count":19904435,"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":["nest-module","nestjs","redlock","redlock-redis"],"created_at":"2024-12-27T13:13:19.837Z","updated_at":"2025-02-27T22:52:08.825Z","avatar_url":"https://github.com/nailyjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔒 Redlock module for nest.js\n\n## Install\n\n```bash\npnpm i @nailyjs.nest.modules/redlock\n```\n\n# Use in your app.module.ts\n\n```ts\nimport { RedlockModule } from \"@nailyjs.nest.modules/redlock\";\nimport { Redis } from \"ioredis\";\nimport { Module } from \"@nestjs/common\";\n\n@Module({\n  imports: [\n    RedlockModule.forRoot({\n      clients: [\n        new Redis({\n          /* Redis options */\n        }),\n      ],\n      options: {\n        /* Redlock options */\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\nAlso you can use `forRootAsync`:\n\n```ts\nimport { RedlockModule } from \"@nailyjs.nest.modules/redlock\";\nimport { Redis } from \"ioredis\";\nimport { Module } from \"@nestjs/common\";\nimport { ConfigService } from \"@nestjs/config\";\n\n@Module({\n  imports: [\n    RedlockModule.forRootAsync({\n      inject: [ConfigService],\n      useFactory(configService) {\n        return {\n          clients: [\n            new Redis({\n              /* Redis options */\n            }),\n          ],\n          options: {\n            /* Redlock options */\n          },\n        };\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n\u003e The `useFactory`'s `configService` argument we use some logic, it will infer to `inject`'s instance type to help you write code.\n\nIn the business service:\n\n```ts\nimport { Injectable } from \"@nestjs/common\";\nimport { RedlockService } from \"@nailyjs.nest.modules/redlock\";\n\n@Injectable()\nexport class AppService {\n  constructor(private readonly redlockService: RedlockService) {}\n}\n```\n\n`RedlockService` extended `Redlock` class, so you can directly to call original redlock methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnailyjs%2Fnest-redlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnailyjs%2Fnest-redlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnailyjs%2Fnest-redlock/lists"}