Home

Awesome

organic-dna-loader

Simple utility module exporting function for loading and transforming DNA into in-memory object representation.

Combines :

api & usage

load from default cwd + '/dna'

var loadDNA = require('organic-dna-loader')
loadDNA(function(err, dna){

})

load from custom directory

var loadDNA = require('organic-dna-loader')
loadDNA('./directory/dna', function(err, dna){

})

load with options

var loadDNA = require('organic-dna-loader')
loadDNA({
  dnaSourcePath: './directory/dna',
  dnaMode: 'customMode'
}, function(err, dna){

})

load from multiple sources

var loadDNA = require('organic-dna-loader')
loadDNA({
  dnaSourcePaths: [
    './directory/dna',
    './directory2/dna2'
  ],
  dnaMode: 'customMode'
}, function(err, dna){

})

dna load hooks

var loadDNA = require('organic-dna-loader')
loadDNA({
  beforeResolve: async function (dna) { },
  afterResolve: async function (dna) { }
}, function(err, dna){

})

load dna as Promise

const loadDNA = require('organic-dna-loader')
let dna = await loadDNA(options)