My opinion on dependency injection (DI) for Node for years has been that it was unnecessary.
We can require this once during our service initialization and then require the same module to get the same instance anywhere it's needed. There are even simple ways to modify this pattern to make dependencies easy to stub or mock when testing.
Your new post is loading...