Class: AsyncEnvironment
@kosko/env.AsyncEnvironment
Hierarchy
BaseEnvironment
↳ AsyncEnvironment
Constructors
constructor
+ new AsyncEnvironment(cwd
: string): AsyncEnvironment
Parameters:
Name | Type |
---|---|
cwd | string |
Returns: AsyncEnvironment
Defined in: packages/env/src/environment/base.ts:27
Properties
cwd
• cwd: string
env
• Optional
env: string | string[]
Current environment.
Defined in: packages/env/src/environment/base.ts:12
extensions
• extensions: string[]
File extensions of environments.
Defined in: packages/env/src/environment/base.ts:25
paths
• paths: Paths
Paths of environment files.
Defined in: packages/env/src/environment/base.ts:17
reducers
• Protected
reducers: Reducer[]
Defined in: packages/env/src/environment/base.ts:7
Methods
component
▸ component(name
: string): any
Returns component variables merged with global variables.
If env is not set or require failed, returns an empty object.
Parameters:
Name | Type | Description |
---|---|---|
name | string | Component name |
Returns: any
Defined in: packages/env/src/environment/base.ts:53
execReducers
▸ Protected
execReducers(name?
: string): any
Parameters:
Name | Type |
---|---|
name? | string |
Returns: any
Defined in: packages/env/src/environment/async.ts:8
global
▸ global(): any
Returns global variables.
If env is not set or require failed, returns an empty object.
Returns: any
Defined in: packages/env/src/environment/base.ts:42
mergeValues
▸ Protected
mergeValues(values
: any[]): any
Parameters:
Name | Type |
---|---|
values | any[] |
Returns: any
Defined in: packages/env/src/environment/async.ts:12
requireModule
▸ Protected
requireModule(id
: string): Promise<any>
Parameters:
Name | Type |
---|---|
id | string |
Returns: Promise<any>
Defined in: packages/env/src/environment/async.ts:16
resetReducers
▸ resetReducers(): void
Resets reducers to the defaults.
Returns: void
Defined in: packages/env/src/environment/base.ts:67
setReducers
▸ setReducers(callbackfn
: (reducers
: Reducer[]) => Reducer[]): void
Sets list of reducers using the specified callback function.
Parameters:
Name | Type |
---|---|
callbackfn | (reducers : Reducer[]) => Reducer[] |
Returns: void
Defined in: packages/env/src/environment/base.ts:60