koa-requireall
v1.0.0
Published
Require all JS in a folder
Downloads
2
Readme
koa-requireall
Koa helper to require all JS files in a folder. Based on node-requireall.
Installation
$ npm install koa-requireall
Example
var requireall = require('koa-requireall');
requireAll(path.join(__dirname, 'modules'), function*(Module){
console.log('Module '+ Module + ' loaded.');
});
API
requireAll(folderPath, onLoadedModuleGenerator)
Loads all JS in a folder at folderPath
as Node.js modules. Calls onLoadedModuleGenerator
for each loaded module.
License
MIT