Skip to content

environment

const environment: object

Defined in: environment.ts:68

Resolves and classifies the current environment.

get: (logger) => "local" | "development" | "ci" | "test" | "preview" | "production" | "agent" = getEnvironment

Resolves the environment from HOLOCRON_ENVIRONMENT, ENVIRONMENT, ENV or NODE_ENV (first set wins), warning and falling back to the default when the value is not recognised.

Resolve the current environment from input or process.env.

Pick<EnvLogger, "warn"> = consoleWarn

"local" | "development" | "ci" | "test" | "preview" | "production" | "agent"

isDeployed: (logger?) => boolean

Whether the current environment is a deployed one (test, preview or production).

Pick<EnvLogger, "warn">

boolean

normalize: (value) => "local" | "development" | "ci" | "test" | "preview" | "production" | "agent" | undefined = normalizeEnvironment

Maps a string or alias (prod, prd, staging, qa, dev, …) to its canonical Environment, or undefined when it is not recognised.

Normalize a string into a canonical Environment. Returns undefined if the value is not recognized.

string

"local" | "development" | "ci" | "test" | "preview" | "production" | "agent" | undefined