Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maxkomarychev/mioc

A zero dependency micro IoC framework
https://github.com/maxkomarychev/mioc

decorators dependency-injection inject injection ioc ioc-container

Last synced: about 1 month ago
JSON representation

A zero dependency micro IoC framework

Awesome Lists containing this project

README

        

# mioc

A zero dependency micro IoC framework

## API

```js
const { container, registry, decorators } = require("mioc");

// register factories
container.setProvider("logger", () => console);

// decorate

@decorators.classDecorator
class Recipient {
@decorators.propertyDecorator("logger") logger = undefined;
}

const recipient = new Recipient();
recipient.logger.log("hello, world!");
```