@balena/jellyfish-environment
TypeScript icon, indicating that this package has built-in type declarations

21.0.4 • Public • Published

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);

/@balena/jellyfish-environment/

    Package Sidebar

    Install

    npm i @balena/jellyfish-environment

    Weekly Downloads

    7

    Version

    21.0.4

    License

    Apache-2.0

    Unpacked Size

    67 kB

    Total Files

    66

    Last publish

    Collaborators

    • dfunckt
    • page
    • balena.io