{"id":18303664,"url":"https://github.com/weecraft/nestjs-upstash-redis","last_synced_at":"2025-04-05T15:31:01.645Z","repository":{"id":190554115,"uuid":"682884395","full_name":"weecraft/nestjs-upstash-redis","owner":"weecraft","description":"NestJs Wrapper for Upstash Redis","archived":false,"fork":false,"pushed_at":"2024-11-18T11:14:16.000Z","size":154,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T07:53:01.957Z","etag":null,"topics":["nestjs","npm","redis","upstash","upstash-redis"],"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/weecraft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-25T05:17:02.000Z","updated_at":"2024-11-12T11:31:11.000Z","dependencies_parsed_at":"2024-08-24T04:25:11.350Z","dependency_job_id":"63144c6e-83b1-4a3f-93c7-b6736eb26225","html_url":"https://github.com/weecraft/nestjs-upstash-redis","commit_stats":null,"previous_names":["nyomansunima/nestjs-upstash-redis","weecraft/nestjs-upstash-redis"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weecraft%2Fnestjs-upstash-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weecraft%2Fnestjs-upstash-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weecraft%2Fnestjs-upstash-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weecraft%2Fnestjs-upstash-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weecraft","download_url":"https://codeload.github.com/weecraft/nestjs-upstash-redis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247358476,"owners_count":20926227,"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":["nestjs","npm","redis","upstash","upstash-redis"],"created_at":"2024-11-05T15:26:20.037Z","updated_at":"2025-04-05T15:31:01.208Z","avatar_url":"https://github.com/weecraft.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Upstash Redis\n\nWrapper for Upstash redis for NestJs\n\n\u003c!-- Shields --\u003e\n\n[![NestJS](https://img.shields.io/badge/nestjs-%23E0234E.svg?style=flat\u0026logo=nestjs\u0026logoColor=white)](https://nestjs.com/)\n![GitHub contributors](https://img.shields.io/github/contributors/nyomansunima/nestjs-upstash-redis)\n![GitHub language count](https://img.shields.io/github/languages/count/nyomansunima/nestjs-upstash-redis)\n![GitHub issues](https://img.shields.io/github/issues/nyomansunima/nestjs-upstash-redis)\n![GitHub](https://img.shields.io/github/license/nyomansunima/nestjs-upstash-redis)\n![GitHub repo size](https://img.shields.io/github/repo-size/nyomansunima/nestjs-upstash-redis)\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n- [Features](#features)\n- [Contributing](#contributing)\n- [License](#license)\n\n## 🚀 Installation\n\n```bash\nnpm install nestjs-upstash-redis\n```\n\n## 🤖 Getting Started\n\nBefore you start using this package, you need to have a Upstash account and a database set up. If you haven't already done this, head over to the [Upstash site](https://upstash.com) and follow their instructions to get started.\n\nOnce you have your Redis credentials, you can configure the package in your NestJS application.\n\n### Configuration\n\nIn your NestJS application, create a `.env` file in the root directory and add your Redis secret key:\n\n```dotenv\nUPSTASH_REDIS_URL = your redis url\nUPSTASH_REDIS_TOKEN = your redis account token\n```\n\nMake sure to load the `.env` file using a package like `@nestjs/config` in your application's app module file.\n\n### Module Registration\n\nRegister the Upstash Redis module in your NestJS application. Import the `UpstashRedisModule` and pass in the configuration options:\n\n```typescript\nimport { Module } from '@nestjs/common'\nimport { UpstashRedisModule } from 'nestjs-upstash-redis'\n\n@Module({\n  imports: [\n    UpstashRedisModule.forRoot({\n      url: process.env.UPSTASH_REDIS_URL,\n      token: process.env.UPSTASH_REDIS_TOKEN,\n      // Other options if needed\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n## 🏀 Usage\n\nWith the Upstash Redis module configured, you can now inject the `UpstashRedisService` into your services or controllers to interact with the redis client.\n\n```typescript\nimport { Injectable } from '@nestjs/common'\nimport { UpstashRedisService } from 'nestjs-upstash-redis'\n\n@Injectable()\nexport class MyService {\n  constructor(private readonly cacheService: UpstashRedisService) {}\n\n  async getCache(key: string): Promise\u003cany\u003e {\n    const res = await cacheService.get(key)\n    return res\n  }\n\n  // Add more methods to interact with upstash redis as needed\n}\n```\n\nIn the example above, we use the `UpstashRedisService.get` method to execute a query against the redis client. You can leverage Upstash redis's powerful query language to perform various operations on your sets.\n\nFor more information on the available query functions and how to use them, refer to the [Upstash Redis documentation](https://upstash.com/docs/redis/overall/getstarted).\n\n## ✅ Features\n\n- Seamless integration with NestJS applications.\n- Easy-to-use API for interacting with Upstash Redis.\n- Utilizes Redis's powerful query language for flexible database operations.\n- Configurable and supports multiple environments using environment variables.\n  \u003cbr/\u003e\n\n## 🩷 Contributing\n\nWe welcome contributions from the community to improve this package. If you find any issues or have suggestions for enhancements, please open an issue or submit a pull request.\n\nTo contribute please follow the instruction on [Contributing](CONTRIBUTING.md)\n\nPlease ensure your code follows the established coding standards and includes appropriate unit tests.\n\n## 🪪 License\n\nThis project is licensed under the [MIT License](LICENSE). Feel free to use and modify the code as you see fit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweecraft%2Fnestjs-upstash-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweecraft%2Fnestjs-upstash-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweecraft%2Fnestjs-upstash-redis/lists"}