Simple utility module exporting function for loading and transforming DNA into in-memory object representation.
Combines :
- "organic-dna-fsloader v1.1.0" for loading .json and .yaml files
- "organic-dna-cellmodes v0.1.1"
- "organic-dna-resolve v1.1.0"
process.env.CELL_MODE
if present is used to fold respectiveDNA[CELL_MODE]
branch into root unlessdnaMode
is provided within options
var loadDNA = require('organic-dna-loader')
loadDNA(function(err, dna){
})
var loadDNA = require('organic-dna-loader')
loadDNA('./directory/dna', function(err, dna){
})
var loadDNA = require('organic-dna-loader')
loadDNA({
dnaSourcePath: './directory/dna',
dnaMode: 'customMode'
}, function(err, dna){
})
var loadDNA = require('organic-dna-loader')
loadDNA({
dnaSourcePaths: [
'./directory/dna',
'./directory2/dna2'
],
dnaMode: 'customMode'
}, function(err, dna){
})
var loadDNA = require('organic-dna-loader')
loadDNA({
beforeResolve: async function (dna) { },
afterResolve: async function (dna) { }
}, function(err, dna){
})
const loadDNA = require('organic-dna-loader')
let dna = await loadDNA(options)