Comparing version 1.1.1 to 1.1.2
@@ -6,9 +6,5 @@ var glob = require('glob'); | ||
module.exports = function(app, config) { | ||
var seedNodules = [], routes = {}; | ||
var rootConfig = { | ||
// set this to true if you have not defined a customDebugger but want to temporality see debugging output | ||
debugToConsole: false, | ||
// directories to look for nodules in, minus exclude pattern - looks in nodules directory by default | ||
@@ -19,2 +15,12 @@ dirs: [ | ||
// default debug function | ||
customDebug: function(identifier) { | ||
return function(msg) { | ||
if (defaultConfig.debugToConsole) console.log(identifier+': '+msg); | ||
}; | ||
}, | ||
// set this to true if you have not defined a customDebugger but want to temporality see debugging output | ||
debugToConsole: false, | ||
noduleDefaults: { | ||
@@ -44,5 +50,5 @@ // array of (or function which returns array of) middleware functions which will be called in order for each nodule on each express request | ||
var defaultConfig = _.merge(_.cloneDeep(rootConfig), config); | ||
var debug = config.customDebug || function(msg) { if (defaultConfig.debugToConsole) console.log(msg); }; | ||
var debug = config.customDebug('nodulejs'); | ||
// find all nodules and init all routes first so they can be sorted based on routeIndex | ||
@@ -53,2 +59,6 @@ defaultConfig.dirs.forEach(function(dir) { loadNodules(dir.path, dir.exclude); }); | ||
return { | ||
defaultConfig: defaultConfig | ||
}; | ||
// finds nodules in supplied dir, minus exclude patterns, and invokes initNodule method on them | ||
@@ -55,0 +65,0 @@ function loadNodules(dir, exclude) { |
{ | ||
"name": "nodulejs", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Utility for discovering and initializing node/express 'nodules'", | ||
@@ -5,0 +5,0 @@ "main": "nodule.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18066
16
109