ConfigSources.toConfig()
Home > @backstage/config-loader > ConfigSources > toConfig
Creates an observable Config implementation from a ConfigSource.
Signature:
static toConfig(source: ConfigSource): Promise<ClosableConfig>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
source |
The config source to read from |
Promise<ClosableConfig>
A promise that resolves to a closable config
Remarks
If you only want to read the config once you can close the returned config immediately.
Example
const sources = ConfigSources.default(...)
const config = await ConfigSources.toConfig(source)
config.close()
const example = config.getString(...)