File System based loading of dna methods.
Loads all (.json|.yaml|.yml) files found recursively in dirPath
and mounts constructed object into dna
.
dna
: Object - the dna instance on which will contain the loaded datadirPath
: String - path to directory containing .json filesnamespace
: String - optional, dot notated path to existing branch which should hold loaded data. By default it is '' pointing to the root of thedna
reference.callback
: Function(err){} - will be invoked once loading is complete
Uses internally loadFile
method
Loads a single file (.json|.yaml|.yml) parsing its contents as JSON structure and mounts into dna
.
dna
: Object - the dna instance on which will contain the loaded datafilePath
: String - path to file containing JSON structurenamespace
: String - optional, dot notated path to existing branch which should hold loaded data. By default it is '' pointing to the root of thedna
reference.callback
: Function(err){} - will be invoked once loading is complete
YAML support includes parsing single or multi-document yaml files. Loading .json and .yaml files for the same namespace merges their contents.