express-load
Advanced tools
Comparing version 0.0.2 to 0.0.3
var express = require('express'); | ||
var load = require('express-load'); | ||
var load = require('../../'); | ||
@@ -4,0 +4,0 @@ var app = express(); |
@@ -16,5 +16,5 @@ module.exports = function(app) { | ||
user.isAuthenticated, | ||
site.controllers.index | ||
site.index | ||
); | ||
}; |
@@ -0,1 +1,9 @@ | ||
0.0.3 / 2012-08-08 | ||
================== | ||
* Ignore directories | ||
* Fixed simple example | ||
* Updated package.json | ||
0.0.2 / 2012-08-07 | ||
@@ -2,0 +10,0 @@ ================== |
@@ -69,9 +69,14 @@ /*! | ||
files.forEach(function(file) { | ||
var filename = path.basename(file, path.extname(file)); | ||
var script = require(path.join(dir, file)); | ||
if (typeof script === 'function') { | ||
script = script(that.app); | ||
var filename = path.basename(file, path.extname(file)) | ||
, fullpath = path.join(dir, file) | ||
if (!fs.statSync(fullpath).isDirectory()) { | ||
var script = require(fullpath); | ||
if (typeof script === 'function') { | ||
script = script(that.app); | ||
} | ||
that.app[name][filename] = script; | ||
console.log('%s: Loaded app.%s.%s', title, name, filename); | ||
} | ||
that.app[name][filename] = script; | ||
console.log('%s: Loaded %s in %s as app.%s.%s', title, file, dir, name, filename); | ||
}); | ||
@@ -89,2 +94,2 @@ } | ||
return new ExpressLoad(dir, app); | ||
}; | ||
}; |
{ | ||
"name": "express-load", | ||
"description": "Load files in a directory with the Express application instance", | ||
"version": "0.0.2", | ||
"description": "Autoload modules into an Express application instance", | ||
"version": "0.0.3", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jarrad Seers", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
7719
113