npm-dependency-injector
Dependecy injector for pure functional npm modules.
Last updated 4 years ago by nicholastancredi .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install npm-dependency-injector 
SYNC missed versions from official npm registry.

npm-dependency-injector

Dependecy injector for pure functional npm modules.

installation

npm install --save npm-dependency-injector

usage

NOTE: node_modules/uuid-v4 is only for the example.

Require your package.json file as the first argument and your modules root function as the second argument followed by any additional arguments.

./index.js

var dependencyInjector = require('npm-dependency-injector'),
    packageJSON = require('./package.json'),
    exampleFunction = require('./exampleFunction.js');

module.exports = dependencyInjector(
    packageJSON,
    exampleFunction
);

./exampleFunction.js

module.exports = function(dependencies) {
    var uuid = dependencies['uuid-v4'];
    return uuid();
};

Current Tags

  • 0.0.12                                ...           latest (4 years ago)

4 Versions

  • 0.0.12                                ...           4 years ago
  • 0.0.111                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |