Comparing version 1.0.10 to 1.0.11
@@ -26,9 +26,4 @@ var glob = require('glob'); | ||
var defaultConfig = _.extend(_.cloneDeep(config), appConfig); | ||
// TODO - look for a cleaner way to do this inside the nodules | ||
// change name from module to nodule in all files | ||
app.initModule = initModule; | ||
return { | ||
seedNodules: seedNodules, | ||
loadNodules: loadNodules, | ||
@@ -42,9 +37,10 @@ registerRoutes: registerRoutes | ||
.filter(doesntMatch.apply(this, exclude)) | ||
.forEach(function(nodule) { require(path.join(root, nodule))(app); }); | ||
} | ||
.forEach(function(file) { initNodule(path.join(root, file)); }); | ||
} | ||
function initModule(file, config) { | ||
function initNodule(filepath) { | ||
var config = require(filepath)(app); | ||
var seedNodule = _.extend(_.cloneDeep(defaultConfig), config); // merge config properties onto default config | ||
seedNodule.path = path.dirname(file); | ||
seedNodule.name = path.basename(file, '.js'); | ||
seedNodule.path = path.dirname(filepath); | ||
seedNodule.name = path.basename(filepath, '.js'); | ||
@@ -91,3 +87,2 @@ // nodules can have multiple routes | ||
}; | ||
} | ||
} |
{ | ||
"name": "nodulejs", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
15775
76