@omgjs/labkit-runtime-config
v0.1.1
Published
Small runtime configuration parsing helpers for Labkit packages and applications.
Readme
@omgjs/labkit-runtime-config
@omgjs/labkit-runtime-config contains small, framework-free parsing helpers for
runtime configuration values.
The package deliberately parses values that are passed into it. It does not
read process.env, import.meta.env, files, or deployment-provider state on
its own.
Owns
- Boolean parsing.
- Number and finite-number parsing.
- Comma-separated list parsing.
- Consistent fallback handling for blank or missing values.
Does Not Own
- Environment source selection.
- Required-secret validation.
- Deployment-provider mapping.
- Server or browser framework integration.
Usage
import {
parseBoolean,
parseFiniteNumber,
parseList,
} from "@omgjs/labkit-runtime-config";
const logReconnects = parseBoolean(env.VITE_GRAPHQL_LOG_RECONNECTS, false);
const watchdogMs = parseFiniteNumber(env.VITE_GRAPHQL_RECONNECT_WATCHDOG_MS, {
fallback: 30_000,
minimum: 1_000,
});
const allowedOrigins = parseList(env.CORS_ORIGIN);Server packages usually wrap these helpers with a config reader. Browser packages usually pass Vite values from app-owned adapter files.
Release Channel
This package is published on npm as part of the Labkit release train. Patch releases may include documentation-only clarifications, so consumers can update within the same minor line without expecting runtime API changes.
Package Format
This package publishes both CommonJS and ESM entry points. Use the package root
import; do not import from dist.
