Methods
(async) combine(root, optionsopt) → {object}
It looks into the path:
* For every JSON file it finds, it creates a key with the file name (without the `.json` extension)
The value will be the contents of the file parsed in JSON.
* For every directory, it creates a key with the file name.
The value will be created by calling the `combine()` function recursively on the subdirectory.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
root |
string | The path to a folder that contains the files and subdirectories | |||||||||||||||||||||
options |
object |
<optional> |
options for customizing the behavior of the algorithm
Properties
|
Throws:
An error if it can't access or parse a file or directory.
Returns:
A JavaScript object (or an array if that's what the data represents).
- Type
- object
Examples
If you want to use `json5` pass `JSON5.parse`.
If you use `js-yaml`, pass `jsYaml.safeLoad`.
If you use `ini`, pass `ini.parse`.