re: Whats your thoughts on using a DI Package for IOC within a node project? VIEW POST


In my opinion, the least benefit that we'll have by using a DI is that we can test our upstream layers and services with fake dependencies as angular does (for example you can inject an in-memory http interceptor and provide some fake data for testing proposes) without doing a lot of boring changes. another one is that you can change your application's behavior by changing dependencies in just one place without changing those in every place (Open-Closed principle).


With jest, we are able to mock the modules and do the same effect. We finally went without DI module as we found we could do it using vanilla js.

code of conduct - report abuse