1.0.7 • Published 3 years ago

@willsoto/nestjs-node-konfig v1.0.7

Weekly downloads
3
License
Apache-2.0
Repository
-
Last release
3 years ago

NestJS Node Konfig

Thanks to Konfig for the inspiration. This library would not have been possible without it.

Documentation is available at https://willsoto.github.io/node-konfig/

Installation

npm install @willsoto/nestjs-node-konfig
yarn add @willsoto/nestjs-node-konfig
pnpm add @willsoto/nestjs-node-konfig

Quick look

// config.module.ts
import { NodeKonfigModule } from "@willsoto/nestjs-node-konfig";
import { Module } from "@nestjs/common";
import { ValueLoader } from "@willsoto/node-konfig-core";

@Module({
  imports: [
    NodeKonfigModule.register({
      storeOptions: {
        loaders: [
          new ValueLoader({
            values: {
              foo: "bar",
            },
          }),
        ],
      },
    }),
  ],
})
export class ConfigModule {}
// some.service.ts
import { Injectable } from "@nestjs/common";
import { Store } from "@willsoto/node-konfig-core";

@Injectable()
export class SomeService {
  constructor(private readonly store: Store) {}
}