1.1.1 • Published 10 years ago

deper v1.1.1

Weekly downloads
5
License
-
Repository
github
Last release
10 years ago

deper

deper is a simple but quite powerful dependecy injector.

The problem it tries to solve is that in node.js all your internal modules requires all its dependecies. This is troublesome when you can't change your dependencies when you for example want to mock something out in a test or switch an implemention without the need to change the naming in every file that uses that dependency.

##Usage

###randomizer.js

var deper = require("deper");
module.exports = deper(function (handsomeUtil) {
  return handsomeUtil.random(1, 10);
});

###main.js

var _ = require("lodash");
var ranomizer = require("./randomizer")(["handsomeUtil"], _);
1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago