Implementation of node-organic/Nucleus
arguments
plasma
- organic plasma instancedna
- dna containing definitions of organelles and their respectivesource
paths.root
- organelles root, will be prepended only whensource
starts with./
- defaults to
process.env.ORGANELLES_PATH || process.cwd()
- defaults to
Builds once organelle using data wrapped in chemical c
.
Chemical should have the following structure:
{
"source": "relative/path/to/organelle",
// ... organelle's own dna data
}
arguments
c.source
having value typeofFunction
- used as Organelle constructorString
- used as path to require Organelle implementation
All Modules representing Organelles instantiated by Nucleus are expected to have the following signature
module.exports = function(plasma, dna) {}
Where:
plasma
is the Nucleus' plasmadna
is the portion of the dna used to instantiate the Organelle
Builds organelles using data wrapped in chemical c
.
Chemical should have one of the following structures:
{
"source": "cwd/relative/path/to/organelle",
// ... organelle's own dna data
-- or --
"branch": "branch.innerBranch"
}
-- or --
"branch.innerBranch"
arguments
c
asObject
c.source
- directly passes control flow tobuildOne
c.branch
- selects dna node using dot notation namespace query (ex: "branch.innerNode") and iterates through the dna node by constructing all found organelles (those dna branches who havesource
property).
c
asString
- indicates dna namespace, uses the same control flow as with chemicals havingc.branch