@empla/coredi
v2.0.4
Published
Dependency Injection library for Node.js and Browser
Downloads
8
Maintainers
Readme
CoreDI
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 ❤️