I used to handle dependency inversion with Inversify, but I was constantly annoyed by two main things:
- You have to import the
@injectdecorator everywhere, which ends up polluting your domain code. - Writing the boilerplate dependency binding code was so repetitive that I wished I could just type a single command —
arise— and have it done automatically.
That's why I decided to create my own DI container, coupled with a command-line interface that handles code analysis (via AST parsing) and generates the registration boilerplate for you.
Some of the Features:
- No decorators and no vendor lock-in.
- ioc-arise supports injecting typed objects,
factory functions, andclassesimplementinginterfacesor inheritingabstract classes. - Multiple lifecycles: singleton and transient. The CLI can detect them if you leave a JS code comment (
@scope singletonor@scope transient) just above the function or object declaration. - Factory functions and value objects can be detected by the CLI via a JSDoc annotation (
@factoryor@value).
You can find more about it here: ioc-arise
Top comments (0)