Skip to main content

Module: @kosko/env

This page is for @kosko/env v2.0.

Previous API docs:

Interfaces

Variables

default

default: Environment

Defined in

packages/env/src/index.node.ts:18

Functions

createAsyncEnvironment

createAsyncEnvironment(): Environment

Returns a new asynchronized Environment.

Returns

Environment

Defined in

packages/env/src/environment/async.ts:11


createAsyncLoaderReducers

createAsyncLoaderReducers(loader): Reducer[]

Returns the default reducers which load environment variables asynchronously using the specified loader.

Parameters

NameType
loaderLoader

Returns

Reducer[]

Defined in

packages/env/src/environment/base.ts:69


createNodeCJSEnvironment

createNodeCJSEnvironment(options?): Environment

Returns a new Environment which loads environment variables using Node.js's require() function.

Parameters

NameType
optionsNodeEnvironmentOptions

Returns

Environment

Defined in

packages/env/src/environment/node-cjs.ts:12


createNodeESMEnvironment

createNodeESMEnvironment(options?): Environment

Returns a new Environment which loads environment variables using ECMAScript module (ESM) import() function.

Parameters

NameType
optionsNodeEnvironmentOptions

Returns

Environment

Defined in

packages/env/src/environment/node-esm.ts:12


createSyncEnvironment

createSyncEnvironment(): Environment

Returns a new synchronized Environment.

Returns

Environment

Defined in

packages/env/src/environment/sync.ts:11


createSyncLoaderReducers

createSyncLoaderReducers(loader): Reducer[]

Returns the default reducers which load environment variables synchronously using the specified loader.

Parameters

NameType
loaderLoader

Returns

Reducer[]

Defined in

packages/env/src/environment/base.ts:61