0.0.2 • Published 3 years ago

@nukleox/configurator v0.0.2

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

Nukleox Configuration

A simple tool to extract configuration values from environment variables or command line arguments to streamline environment specific configuration in cloud native apps.

Getting started

import { configurator } from '@nukleox/configurator';

const configSpec = {
// by convention, supports LOGGER_NAME and --logger-name to override this value
  loggerName: {
    default: 'test-config',
  },
  loggerLevel: {
    default: 'debug',
  },
// by convention, supports VERBOSE and -v to override this value
  verbose: {
    flag: '-v,
    default: false
  }
};

configurator(configSpec).subscribe(config => {

  // access your config object here
  config.loggerLevel;
  config.loggerName;

});

You can add a .env file to your host project to override config values for various environments. You can also inject a config-map to change environment variables per environment in kubernetes.