open-index/open-npm huggingface dataset:
npm package: @nestjs-crud/core
Description: NestJs CRUD for RESTful APIs
Author: Lawrence Onah
Latest version: 1.0.1

<div align="center">
  <h1>@nestjs-crud/core</h1>
</div>
<div align="center">
  <strong>for RESTful APIs built with NestJs</strong>
</div>

## Install

```shell
npm i @nestjs-crud/core class-transformer class-validator
```
npm package: @nestjs-crud/drizzle
Description: NestJs CRUD for RESTful APIs - Drizzle ORM
Author: Lawrence Onah
Latest version: 1.0.1

<div align="center">
  <h1>@nestjs-crud/drizzle</h1>
</div>
<div align="center">
  <strong>for RESTful APIs built with NestJs</strong>
</div>

## Install

```shell
npm i @nestjs-crud/drizzle drizzle-orm
```
npm package: @nestjs-crud/mikro-orm
Description: NestJS CRUD MikroORM adapter
Author: Lawrence Onah
Latest version: 1.0.1

<div align="center">
  <h1>@nestjs-crud/mikro-orm</h1>
</div>
<div align="center">
  <strong>for RESTful APIs built with NestJs</strong>
</div>

## Install

```shell
npm i @nestjs-crud/mikro-orm @mikro-orm/core @mikro-orm/knex
```
npm package: @nestjs-crud/request
Description: NestJs CRUD for RESTful APIs - request query builder
Author: Lawrence Onah
Latest version: 1.0.1

<div align="center">
  <h1>@nestjs-crud/request</h1>
</div>
<div align="center">
  <strong>for RESTful APIs built with NestJs</strong>
</div>

## Install

```shell
npm i @nestjs-crud/request
```
npm package: @nestjs-crud/typeorm
Description: NestJs CRUD for RESTful APIs - TypeORM
Author: Lawrence Onah
Latest version: 1.0.1

<div align="center">
  <h1>@nestjs-crud/typeorm</h1>
</div>
<div align="center">
  <strong>for RESTful APIs built with NestJs</strong>
</div>

## Install

```shell
npm i @nestjs-crud/typeorm @nestjs/typeorm typeorm
```
npm package: @nestjs-decorators/cache-decorator
Description: This library was generated with [Nx](https://nx.dev).
Author: Vivek Vishal Sharma
Latest version: 1.0.2

# NestJS Caching Decorator

This package provides a caching decorator for NestJS APIs. It allows you to easily cache the results of your API endpoints using Redis.

## Installation

To use the caching decorator, install the package:

```sh
npm install @nestjs-decorators/cache-decorator


Configuration
First, import the CacheDecoratorModule in your main AppModule:

import { Module } from '@nestjs/common';
import { CacheDecoratorModule } from '@nestjs-decorators/cache-decorator';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    CacheDecoratorModule.forRoot(
      {
      host: 'localhost',
      port: 6379,
      password: 'xxxxx', // Replace with your Redis password
      tls: 'any certificate which is required' , // Replace with your TLS certificate if needed
      enableOfflineMode: true // Enable offline mode support
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
)
export class AppModule {}

Usage
To cache the results of an API endpoint, use the @Cached decorator provided by the package.

import { Controller, Get } from '@nestjs/common';
import { Cached } from '@nestjs-decorators/cache-decorator';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  @Cached(1000) // Cache duration in milliseconds
  getData() {
    return this.appService.getData();
  }
}

In this example, the getData method will cache its result for 1000 milliseconds. You can adjust the cache duration as needed.
```

## Offline Mode Support

The cache-decorator-nestjs project includes Offline Mode support to ensure seamless operation even if Redis is temporarily unavailable. When Redis is down, the cache will fall back to an in-memory storage mechanism.

Key Features of Offline Mode:
-- Automatic detection of Redis availability.
-- In-memory caching as a fallback.
-- Configurable via the RedisProviderOptions interface.
-- Offline Mode in Action

If Redis becomes unavailable, the module will automatically switch to using in-memory storage for caching. This ensures uninterrupted caching functionality, providing resilience to your application.