Skip to main content

Environment variables

Basic and most common synchronous provider. Retrieves data from process.env.

import {env, type} from '@pallad/config';

// retrieves `FOO` environment variable
env('FOO');

// retrieves `FOO` environment variable and converts it to int
env('FOO', {transformer: type.int});

// retrieves `FOO` environment variable and converts it to int, if not available uses: 1000
env('FOO', {transformer: type.int, default: 1000});