express-load
Advanced tools
Comparing version 1.1.14 to 1.1.15
@@ -73,2 +73,3 @@ /*! | ||
var entity = this.__getEntity(loc); | ||
var queue = []; | ||
@@ -97,3 +98,3 @@ if (entity) { | ||
if (allow && fs.statSync(script).isDirectory()) { | ||
this.then(path.join(location, dir[file])); | ||
queue.push(this.then.bind(this, path.join(location, dir[file]))); | ||
allow = false; | ||
@@ -124,2 +125,9 @@ } | ||
} | ||
// If we have directories in queue to process, then process them now. | ||
if (queue.length) { | ||
for (var index in queue) { | ||
queue[index](); | ||
} | ||
} | ||
} else { | ||
@@ -234,9 +242,12 @@ var location = path.dirname(location) | ||
var notAsync = typeof mod !== 'function' || mod.length < 2; | ||
if (!notAsync) { | ||
mod = mod.call(script, instance, function () { | ||
self.__log('Loaded *.' + map.join('.')); | ||
next(); | ||
}); | ||
} else if (typeof mod === 'function') { | ||
mod = mod.call(script, instance); | ||
if (self.options.invoke !== false) { | ||
if (!notAsync) { | ||
mod = mod.call(script, instance, function () { | ||
self.__log('Loaded *.' + map.join('.')); | ||
next(); | ||
}); | ||
} else if (typeof mod === 'function') { | ||
mod = mod.call(script, instance); | ||
} | ||
} | ||
@@ -243,0 +254,0 @@ |
{ | ||
"name": "express-load", | ||
"description": "Autoload modules into an Express application instance, config, models, routes, controllers etc...", | ||
"version": "1.1.14", | ||
"version": "1.1.15", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jarrad Seers", |
# Express Load | ||
## NOTE: | ||
The successor to this module is here: [consign](https://www.npmjs.com/package/consign) it's not express specific and is lighter in weight. Check it out :) | ||
The _express-load_ module provides the ability to load scripts into an Express instance from specified directories or files. | ||
@@ -4,0 +7,0 @@ Make large express MVC applications easier to develop by allowing a logical file separation without having to require your scripts. |
Sorry, the diff of this file is not supported yet
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
224
15936
6
247