open-index/open-npm huggingface dataset:
npm package: @microservice-stack/local-deployment
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.1.56

# local-deployment

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build local-deployment` to build the library.

## Running unit tests

Run `nx test local-deployment` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @microservice-stack/module-config
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.1.25
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# nest-modules-config

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build nest-modules-config` to build the library.

## Running unit tests

Run `nx test nest-modules-config` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @microservice-stack/module-health
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.1.25
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# nest-modules-health

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build nest-modules-health` to build the library.

## Running unit tests

Run `nx test nest-modules-health` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @microservice-stack/module-rabbitmq
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.1.25
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# nest-modules-rabbitmq

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build nest-modules-rabbitmq` to build the library.

## Running unit tests

Run `nx test nest-modules-rabbitmq` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @microservice-stack/module-typeorm-migrations
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.1.25
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# nest-modules-typeorm-migrations

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build nest-modules-typeorm-migrations` to build the library.

## Running unit tests

Run `nx test nest-modules-typeorm-migrations` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @microservice-stack/nest-application
Description: This library streamlines the nest service start configuration by providing default nest configuration including&#x20;
Latest version: 0.1.56

# Application

This library streamlines the nest service start configuration by providing default nest configuration including&#x20;

* Fastify framework instead of Express because of its superior performance
* Winston logger formatted to raw JSON, so your service logs can easily be connected to services such as Datadog
* Enabled global Validation pipe for the use of class validator decorators
* Enabled cors

```typescript
import { AppModule } from './app.module';
import { startService } from '@microservice-stack/nest-application';

async function bootstrap(): Promise<void> {
  await startService('Service Name', AppModule);
}

bootstrap();
```
npm package: @microservice-stack/nest-config
Description: This library wraps the default `@nestjs/config` library and adds the ability to define variables that are required for the service to launch and the ability to parse environment variables.
Latest version: 0.1.56

# Config
This library wraps the default `@nestjs/config` library and adds the ability to define variables that are required for the service to launch and the ability to parse environment variables.

```typescript
import { Module } from '@nestjs/common';
import { ConfigModule } from '@microservice-stack/nest-config';

@Module({
  imports: [
    ConfigModule.register({
      requiredEnvironmentVariables: [
        'STRING_VARIABLE',
        'JSON_VARIABLE',
      ],
      parse: (configVariable, value) => {
        if (configVariable === 'JSON_VARIABLE') {
          return JSON.parse(value);
        }

        return value;
    }),
  ],
  controllers: [],
  providers: [],
})
export class AppModule {}

```

The `ConfigModule` is registered globally, so you can inject it as you wish

```typescript
import { ConfigService } from '@microservice-stack/nest-config';

export class AppService {
  constructor(private configService: ConfigService) {}
    
  public hello(): string {
    return this.configService.get('STRING_VARIABLE');
  }
}
```
npm package: @microservice-stack/nest-health
Description: This library provides a module that adds a `/health` endpoint to your nest service. This endpoint can be used for Kubernetes health checks.
Latest version: 0.1.56

# Health

This library provides a module that adds a `/health` endpoint to your nest service. This endpoint can be used for Kubernetes health checks.

```typescript
import { Module } from '@nestjs/common';
import { HealthModule } from '@microservice-stack/nest-health';

@Module({
  imports: [HealthModule],
})
export class AppModule {}
```
npm package: @microservice-stack/nest-rabbitmq
Description: This library provides a module that enables the usage of RabbitMQ inside your project. It comes with support for publishing events as well as subscribing to them
Latest version: 0.1.56

# RabbitMQ

This library provides a module that enables the usage of RabbitMQ inside your project. It comes with support for publishing events as well as subscribing to them

### Import

```typescript
import { Module } from '@nestjs/common';
import { RabbitmqModule } from '@microservice-stack/nest-rabbitmq';
import { ConfigModule, ConfigService } from '@microservice-stack/nest-config';

@Module({
  imports: [
    RabbitmqModule.register({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (configService: ConfigService) => ({
        uri: configService.get('QUEUE_URL'),
      }),
    }),
  ],
})
export class AppModule {}
```

### Publish

```typescript
export interface HelloWorldEventPayload {
  hello: string;
}

export const HELLO_WORLD_EVENT = new Event<HelloWorldEventPayload>('hello.world', 1);
```

```typescript
import { RabbitmqService } from '@microservice-stack/nest-rabbitmq';
import { HELLO_WORLD_EVENT } from './constants';

export class HelloService {
  constructor(private queueService: RabbitmqService) {}

  public sayHello(): void {
    this.queueService.publishEvent(HELLO_WORLD_EVENT, { hello: 'world' });
  }
}
```

### Subscribe

Queue controllers should be defined separately from Rest controllers as any Rest endpoints defined in them will not work.

```typescript
import { Controller } from "@nestjs/common";
import { Subscribe } from "@microservice-stack/nest-rabbitmq";
import { HELLO_WORLD_EVENT, HelloWorldEventPayload } from './constants';

@Controller()
export class HelloQueueController {
  static CONTROLLER_QUEUE_NAME = 'hello-queue';

  @Subscribe(HELLO_WORLD_EVENT, HelloQueueController.CONTROLLER_QUEUE_NAME)
  public hello(payload: HelloWorldEventPayload): void {
    console.log(payload.hello);
  }
}
```
npm package: @microservice-stack/workspace
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.1.56

# workspace

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build workspace` to build the library.

## Running unit tests

Run `nx test workspace` to execute the unit tests via [Jest](https://jestjs.io).