@empla/coredi

2.0.4 • Public • Published

CoreDI

codecov Build and Test Dependabot GitHub release (latest SemVer) GitHub npm

Dependency Injection library for Node.jS and Browser

Features

  • Node.js and Browser support
  • Well tested code
  • Container fork support
  • Recursive dependencies resolving support
  • Service Groups support

Installation

npm install @empla/coredi

Usage

const coredi = require('@empla/coredi');

coredi({
    app: {
        loaders: [
            {
                name: 'myservice',
                config: {
                    param: 'defaultValue'
                },
                async create(container) {
                    return myServiceObject;
                },
            },
        ],
    },
}, 'app').then(function(container) {
    const myservice = container('myservice');  
    // ...
});

Documentation

Visit official site for documentation

How to build project

Install:

npm install

Test:

npm test

Lint code:

npm run lint

Browser tests:

npm run bundle

and open browser-test.html in your browser.

License

CoreDI licensed under MIT License

Maintainers


Copyright (c) 2020 EMPLA GROUP, LLP

Made with ❤️

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.4
    3
    • latest

Version History

Package Sidebar

Install

npm i @empla/coredi

Weekly Downloads

3

Version

2.0.4

License

MIT

Unpacked Size

43.4 kB

Total Files

34

Last publish

Collaborators

  • malikzh