0.2.0 • Published 9 years ago

require-props v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

require-props

Require a set of modules, and add them as properties to target.

NPM module NPM downloads

Installation

npm install --save require-props

Usage

  const requireProps = require('require-props')(__dirname);
  const target = {name:'target'};
  requireProps(target, ['./fixtures/module1', './fixtures/module-2']);
  console.dir(target);
  // { name: 'target', module1: 1, 'module-2': 'target' }

Each required modules must export a function receiving the app instance and returning an object that is then added as a property on the app instance, named as the modules itself.

Api

requireProps(target, modules)

  • target: object - object where all properties are created
  • modules: array - list of modules to requires. They could be module names or relative paths.

License

The MIT License (MIT)

Copyright (c) 2015 Andrea Parodi

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago