1.0.3 • Published 6 years ago

@kizzlebot/kiz-di v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

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')));
};