nestjs-dynamic-config
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Nest.js Dynamic Configuration Module

This module allows to automatically watch & reload configuration in runtime. For instance, Nest.js server may be used together with Vault Agent on Kubernetes and this module allows to continuously reload secrets file mounted in attached volume.

import { DynamicConfigModule } from 'nestjs-dynamic-config';
 
const onError = (error: Error) => {
  appLogger.error(error.message, error.stack, 'Config');
  process.exit(1);
};
 
export const ConfigModule = DynamicConfigModule.forRoot({
  logger: appLogger,
  source: DynamicConfigSource.FILE,
  configFilePath: process.env['CONFIG_FILE'], // 
  watchForChanges: !isTestEnv(), // Chokidar causes Jest to leak memory in tests.
  onError,
  parseConfig,
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i nestjs-dynamic-config

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

33.4 kB

Total Files

43

Last publish

Collaborators

  • redscorpio