@kizzlebot/kiz-di
v1.0.3
Published
A small wrapper around the [Awilix](https://github.com/jeffijoe/awilix) dependency injection package.
Downloads
1
Readme
Flex DI
A small wrapper around the Awilix dependency injection package.
Only supports register as value.
Example
const { createContainer, register, load, injectFn, injectObj, pipe } = require('@flexshopper/flex-di');
const start = () => {
return createContainer({ basePath: __dirname })
.then(pipe(load('./clients/*.js'), injectFn, register('Client')))
.then(pipe(load('./services/*.js'), injectFn, register('Service')))
.then(pipe(load('./repositories/*.js'), injectObj, register('Repository')));
};