@balena/jellyfish-environment
v21.0.4
Published
Environment variable library for Jellyfish
Downloads
1,802
Readme
Jellyfish environment
Environment variable library for Jellyfish.
This module aims to be the startup system configuration hub and exposes any runtime settings to the rest of the system. Its the only place in the codebase that should ever read environment variables.
Usage
Use exported environment variables:
import { defaultEnvironment } from '@balena/jellyfish-environment';
console.log('Metrics Port:', defaultEnvironment.metrics.ports.app);
const environment = require('@balena/jellyfish-environment').defaultEnvironment
console.log('Metrics Port:', environment.metrics.ports.app)
Inject your own environment:
import { getEnvironment } from '@balena/jellyfish-environment';
const environment = getEnvironment({
METRICS_PORT: 1234,
});
console.log('Metrics Port:', environment.metrics.ports.app);