@versionzero/configurator / configuration-sources / JsonFileSource
Class: JsonFileSource
Defined in: configuration-sources/json-file-source.js:19
JsonFileSource - load assignments from a JSON formatted configuration file, or stdin if passed "-"
This leverages ObjectSource once the data has been pulled in.
Multiple configuration file sources may exist; each needs to examine the path / file and independently decide whether they will handle it. By contract, when a configuration file source reads the file, it must delete the config key from the context to ensure no other source also reads it. (Configurator will throw a "could not load file" error if the context key still exists after all sources are loaded).
Extends
Methods
load()
load(
schema,context,options?):Promise<Map<string,any>>
Defined in: configuration-sources/json-file-source.js:35
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | CompiledSchema | - |
context | any | - |
options? | any | - |
Returns
Promise<Map<string, any>>