reapply-list
v0.1.0
Published
Require a list of modules and apply the export if it is function.
Downloads
17
Maintainers
Readme
reapply-list
Require a list of modules and apply the export if it is function.
npm install reapply-list --save
npm stats
API Example
index.js
var app = {}
var reapply = require('reapply-list')
var configs = ['cors', 'basic-auth', 'router']
reapply(configs, [app], './app/config')
app/config/*.js
module.exports = function (app) {
// configure `app` here.
}
Features
- Supports optional arguments.
- Supports optional base directory.
API
reapplyList(list[, args][, base])
arguments
list: (Array)
list of module names or relative paths to require.[args]: (Array)
arguments to pass to modules.[base]: (String)
module base directory.
returns
(Array)
result of applying functions..
Alternatives
- Use reapply.js if you need something slightly different or need more control.
Contributing
SEE: contributing.md