Skip to main content
Version: Current

config

@rotorsoft/act-root


@rotorsoft/act-root / act/src / config

Function: config()

config(): Config

Defined in: libs/act/src/config.ts:157

Gets the current Act Framework configuration.

Configuration is loaded from package.json and environment variables, providing type-safe access to application metadata and runtime settings.

Environment Variables:

  • NODE_ENV: "development" | "test" | "staging" | "production" (default: "development")
  • LOG_LEVEL: "fatal" | "error" | "warn" | "info" | "debug" | "trace"
  • LOG_SINGLE_LINE: "true" | "false" (default: "true")
  • SLEEP_MS: Milliseconds for sleep utility (default: 100, 0 for tests)

Defaults by environment:

  • test: logLevel="error", sleepMs=0
  • production: logLevel="info"
  • development: logLevel="trace"

Returns​

Config

The validated configuration object

Example​

Basic usage

import { config } from "@rotorsoft/act";

const cfg = config();
console.log(`App: ${cfg.name} v${cfg.version}`);
console.log(`Environment: ${cfg.env}`);
console.log(`Log level: ${cfg.logLevel}`);

See​

Config for configuration type