JavaScript tool library based on DI. You can use this tool to register modules, resolve dependencies, and uninstall modules.
npm install --save di-util
yarn add di-util
Example:
var DIUtil = require('di-util);
console.log(DIUtil.env);
DIUtil.register('key1', [1, 2], true)
console.log(DIUtil.key1); // => [1, 2]
var resolveFn = DIUtil.resolve(['key1', function (a, b, c) {
console.log('a', a);
console.log('b', b);
console.log('c', c);
}])
resolveFn(11, 22, 33);
// =>
// 'a' [1, 2]
// 'b' 11
// 'c' 22
DIUtil.unregister('key1');
console.log(DIUtil.key1); // => undefined