Library to load configuration data from YAML files depending of NODE_ENV value.
Default config service that loads config from YAML files with path of one of next options:
- ZENOX_CONFIG_DIR env variable.
- ZENOX_PROJECT_DIR env variable plus "config" child.
- Current working directory plus "config" child.
import {Config} from '@zenox/config';
let port = Config.get('http.port');
Custom config service that loads config from object literal.
import {ConfigService} from '@zenox/config';
let config = new ConfigService({http: {port: 3000}});
let port = config.get('http.port');
Custom config service that loads config from path of directory with YAML files.
import {ConfigService} from '@zenox/config';
let path = '<relative path to config dir>';
let config = ConfigService.fromYaml(path);
let port = config.get('http.port');