reapply-list

0.1.0 • Public • Published

reapply-list

Require a list of modules and apply the export if it is function.

Build Status Code Climate js-standard-style

npm install reapply-list --save
npm stats

npm NPM downloads Dependency Status

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

Licenses

GitHub license

Package Sidebar

Install

npm i reapply-list

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • wilmoore