open-index/open-npm huggingface dataset:
npm package: @nestjs-steroids/environment
Description: Extremely simple environment module (config loader) for your NestJS application
Author: Vlad Krokhin
Latest version: 1.0.2

<h1 align="center">Environment</h1>
Extremely simple environment module (config loader) for your NestJS application

## Installation
```bash
npm install @nestjs-steroids/environment
```
## Usage
First of all, let's define our application environment
### AppEnvironment
```typescript
import { IsEnum, IsNumber, Max, Min } from 'class-validator';
import { Transform } from 'class-transformer';
import { Env } from '@nestjs-steroids/environment';

enum NodeEnv {
  Development = 'development',
  Production = 'production'
}

export class AppEnvironment {
  /**
   * Env decorator mark environment variable that we want to assign
   * (Tip) Without name env Env decorator makes auto UPPER_SNAKE_CASE conversion (e.g. isTest -> IS_TEST)
   */
  @Env('PORT')
  /**
   * Transform is useful for all sorts of transformations or parsing complex values
   * For example: @Transform(value => value.toLowerCase() === 'true')
   */
  @Transform(parseInt)
  /**
   * Also, you could use class-validator operators for validation of the correctness of environment variables
   */
  @IsNumber()
  @Min(0)
  @Max(65535)
  port: number;

  @Env('NODE_ENV')
  @IsEnum(NodeEnv)
  nodeEnvironment: NodeEnv
}
```
### AppModule
Then, register `EnvironmentModule` in your application 
```typescript
import { Module } from '@nestjs/common';
import { EnvironmentModule } from '@nestjs-steroids/environment';
import { AppEnvironment } from './app-environment';

@Module({
  imports: [
    EnvironmentModule.forRoot({
      isGlobal: true,
      loadEnvFile: true,
      useClass: AppEnvironment,
    }),
  ],
})
export class AppModule {}
```

### AppService
Let's use our application environment in services
```typescript
import { Injectable } from '@nestjs/common';
import { AppEnvironment } from './app-environment';

@Injectable()
export class AppService {
  constructor(private readonly appEnvironment: AppEnvironment) {}

  getNodeEnvironment(): string {
    return `Application environment is: ${this.appEnvironment.nodeEnvironment}`;
  }
}
```

## Advanced usage
Sometimes we need access to our environments without creation NestJS application (e.g. ORM config, etc.).
So we can create an `AppEnvironment` using `getEnvironment` factory method and use it like class with static properties.
```typescript
import { getEnvironment } from '@nestjs-steroids/environment';
export const appEnv = getEnvironment<AppEnvironment>(AppEnvironment)

// Usage
appEnv.nodeEnvironment
```
Also, we can reuse this instance in `EnvironmentModule`
```typescript
import { Module } from '@nestjs/common';
import { EnvironmentModule } from '@nestjs-steroids/environment';
import { appEnv, AppEnvironment } from './app-environment';

@Module({
  imports: [
    EnvironmentModule.forRoot({
      isGlobal: true,
      loadEnvFile: true,
      useClass: AppEnvironment, // Class that we want to provide
      useValue: appEnv, // Class than we want to provide
    }),
  ],
})
export class AppModule {}

```

## License
[MIT](LICENSE.md)
npm package: @nestjs-stitcher/auth
Description: JWT authentication module with JWKS support for @nestjs-stitcher
Author: Bridges Wood
Latest version: 0.1.0

# @nestjs-stitcher/auth

JWT authentication module with JWKS support for @nestjs-stitcher.

## Installation

```bash
npm install @nestjs-stitcher/auth
```

## Usage

```typescript
import { Module } from '@nestjs/common';
import { AuthModule } from '@nestjs-stitcher/auth';

@Module({
  imports: [
    AuthModule.forRoot({
      strategy: 'remote',
      jwksEndpoints: ['https://auth-service/.well-known/jwks.json'],
      jwt: { issuer: 'my-app', audience: 'my-app:api' },
    }),
  ],
})
export class AppModule {}
```

### Guards & Decorators

```typescript
import { CurrentUser, Public, Roles } from '@nestjs-stitcher/auth';

@Resolver()
export class UsersResolver {
  @Public()
  @Query(() => String)
  health() {
    return 'ok';
  }

  @Roles(['admin'])
  @Query(() => [User])
  users(@CurrentUser() user: StitcherUser) {
    // user.id, user.roles available
  }
}
```

## Documentation

For full documentation and architecture overview, see the [main README](https://github.com/bridges-wood/nestjs-stitcher#readme).

## License

MIT
npm package: @nestjs-stitcher/common
Description: Shared types, HMAC utilities, and error classes for @nestjs-stitcher
Author: Bridges Wood
Latest version: 0.1.0

# @nestjs-stitcher/common

Shared types, HMAC utilities, and error classes for @nestjs-stitcher.

## Installation

```bash
npm install @nestjs-stitcher/common
```

## Overview

This package provides the foundational building blocks used across the `@nestjs-stitcher` ecosystem:

- **Types** — `StitcherUser`, config tokens, and shared interfaces
- **HMAC utilities** — HMAC-SHA256 signing and verification helpers
- **Error classes** — Standardised GraphQL error types

## Usage

```typescript
import { StitcherUser } from '@nestjs-stitcher/common';

// StitcherUser is the standard user type passed through
// gateway extensions to subgraphs
const user: StitcherUser = {
  id: 'user-123',
  roles: ['admin'],
};
```

## Documentation

For full documentation and architecture overview, see the [main README](https://github.com/bridges-wood/nestjs-stitcher#readme).

## License

MIT
npm package: @nestjs-stitcher/gateway
Description: Schema stitching gateway module for NestJS GraphQL
Author: Bridges Wood
Latest version: 0.1.0

# @nestjs-stitcher/gateway

Schema stitching gateway module for NestJS GraphQL.

## Installation

```bash
npm install @nestjs-stitcher/gateway
```

## Usage

```typescript
import { Module } from '@nestjs/common';
import { GatewayModule, AuthVisitor, SignatureVisitor } from '@nestjs-stitcher/gateway';

@Module({
  imports: [
    GatewayModule.forRoot({
      endpointsConfigPath: './config.yml',
      hmacSecret: process.env.HMAC_SECRET,
      extensionVisitors: [
        new AuthVisitor(),
        new SignatureVisitor({ hmacSecret: process.env.HMAC_SECRET }),
      ],
      autoReloadInterval: 300_000,
    }),
  ],
})
export class AppModule {}
```

### Endpoints Config (`config.yml`)

```yaml
endpoints:
  - name: users-service
    hash: abc123
    url: https://localhost:4001/graphql
  - name: products-service
    hash: def456
    url: https://localhost:4002/graphql
```

## Documentation

For full documentation and architecture overview, see the [main README](https://github.com/bridges-wood/nestjs-stitcher#readme).

## License

MIT
npm package: @nestjs-stitcher/subgraph
Description: Subgraph helpers for NestJS services in a stitched GraphQL architecture
Author: Bridges Wood
Latest version: 0.1.0

# @nestjs-stitcher/subgraph

Subgraph helpers for NestJS services in a stitched GraphQL architecture.

## Installation

```bash
npm install @nestjs-stitcher/subgraph
```

## Usage

```typescript
import { Module } from '@nestjs/common';
import { SubgraphModule } from '@nestjs-stitcher/subgraph';

@Module({
  imports: [
    SubgraphModule.forRoot({
      hmacSecret: process.env.HMAC_SECRET,
    }),
  ],
})
export class UsersServiceModule {}
```

Use `prepareSchemaForFederation()` as a schema transformer in your GraphQL module config to make the schema stitchable:

```typescript
import { prepareSchemaForFederation } from '@nestjs-stitcher/subgraph';

// In your GraphQL module configuration
transformSchema: prepareSchemaForFederation(),
```

## Documentation

For full documentation and architecture overview, see the [main README](https://github.com/bridges-wood/nestjs-stitcher#readme).

## License

MIT
npm package: @nestjs-toolkit/base
Description: Core helpers
Author: Valmir Barbosa
Latest version: 2.0.5

## Descrição

Pacote com várias funções helpers para agilizar o desenvolvimento com [Nest](https://github.com/nestjs/nest) framework.

## Instalação

```bash
$ yarn add @nestjs-toolkit/base
```

## Teste

```bash
# unit tests
$ yarn test

# test coverage
$ yarn test:cov
```

## Licença

[MIT](LICENSE)
npm package: @nestjs-toolkit/chunk-stream
Description: A simple chunk stream for NestJS
Author: Valmir Barbosa
Latest version: 2.0.1

## Descrição

Pacote para facilitar a criação de stream de dados em chunks.

## Instalação

```bash
$ yarn add @nestjs-toolkit/chunk-stream
```

## Teste

```bash
# unit tests
$ yarn test

# test coverage
$ yarn test:cov
```

## Licença

[MIT](LICENSE)
npm package: @nestjs-toolkit/graphql-apollo
Description: NestJS Toolkit - GraphQL Apollo
Author: Valmir Barbosa
Latest version: 2.1.0

## Descrição

Ferramentas para facilitar o desenvolvimento de aplicações com NestJS,
utilizando [Apollo GraphQL](https://www.apollographql.com/docs/apollo-server).

## Instalação

```bash
$ yarn add @nestjs-toolkit/graphql-apollo
```

Setup

```typescript
import {Module} from '@nestjs/common';
import {GraphQLModule} from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import {CustomDateResolver, CustomNumberResolver} from '@nestjs-toolkit/graphql-apollo/resolvers';

@Module({
    imports: [
        GraphQLModule.forRoot<ApolloDriverConfig>({
            driver: ApolloDriver,
        }),
    ],
    providers: [CustomDateResolver, CustomNumberResolver],
})
export class AppModule {
}
```

## Teste

```bash
# unit tests
$ yarn test

# test coverage
$ yarn test:cov
```

## Licença

[MIT](LICENSE)
npm package: @nestjs-toolkit/graphql-mercurius
Description: NestJS Toolkit - GraphQL Mercurius
Author: Valmir Barbosa
Latest version: 2.0.3

## Descrição

Ferramentas para facilitar o desenvolvimento de aplicações com NestJS,
utilizando [Mercurius GraphQL](https://mercurius.dev).

## Instalação

```bash
$ yarn add @nestjs-toolkit/graphql-mercurius
```

Setup

```typescript
import {Module} from '@nestjs/common';
import {GraphQLModule} from '@nestjs/graphql';
import {MercuriusDriver, MercuriusDriverConfig} from '@nestjs/mercurius';
import {CustomDateResolver, CustomNumberResolver} from '@nestjs-toolkit/graphql-mercurius/resolvers';

@Module({
    imports: [
        GraphQLModule.forRoot<MercuriusDriverConfig>({
            driver: MercuriusDriver,
            graphiql: true,
            typePaths: [
                './**/*.graphql',
                './node_modules/@nestjs-toolkit/graphql-mercurius/schemas/*.graphql'
            ]
        }),
    ],
    providers: [CustomDateResolver, CustomNumberResolver],
})
export class AppModule {
}
```

## Teste

```bash
# unit tests
$ yarn test

# test coverage
$ yarn test:cov
```

## Licença

[MIT](LICENSE)