npm i --save json-config-read
- ConfigReadOptions
- configReadSync
- configReadAsync
- configsListAsync
- configsListSync
- configsReadManyAsync
- configsReadManySync
Config read options type
-
options
(Partial<ConfigReadOptions> | undefined | null) The options to merge, (optional, defaultnull
)
True if directories can be read merging all files inside them
Type: boolean
The root path to use. If unspecified, current directory is used.
Type: string
The file extensions that are parseable.
The default options.
Type: Partial<ConfigReadOptions>
Reads a configuration file or directory synchronously.
-
configPath
string Path of the file or directory to load -
options
Partial<ConfigReadOptions> The options (optional, defaultConfigReadOptions.default
)
Returns any The loaded data
Reads a configuration file or directory asynchronously.
-
configPath
string Path of the file or directory to load -
options
Partial<ConfigReadOptions> The options (optional, defaultConfigReadOptions
)
Returns Promise<any> A promise that resolves the loaded data
Lists all configurations in a directory, asynchrounously.
-
folderPath
string Path of the folder that contains multiple configurations to list -
options
Partial<ConfigReadOptions> The options (optional, defaultConfigReadOptions
)
Returns Promise<Array<string>> A promise that resolves a list of full paths
Lists all configurations in a directory, synchrounously.
-
folderPath
string Path of the folder that contains multiple configurations to list -
options
Partial<ConfigReadOptions> The options (optional, defaultConfigReadOptions
)
Returns Array<string> A list of all full paths of all configurations
Reads all the configurations contained in a folder to a map object
-
folderPath
string Path of the folder that contains multiple configurations to load -
options
Partial<ConfigReadOptions> The options (optional, defaultConfigReadOptions
)
Returns Promise<Object<string, any>> A promise that resolves a map of loaded configurations
Reads all the configurations contained in a folder to a map object
-
folderPath
string Path of the folder that contains multiple configurations to load -
options
Partial<ConfigReadOptions> The options (optional, defaultConfigReadOptions
)