@kizzlebot/kiz-di

1.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @kizzlebot/kiz-di

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

4.4 kB

Total Files

4

Last publish

Collaborators

  • kizzlebot