Node.js Why Use Dependency Injection

Example

  1. Fast Development process
  2. Decoupling
  3. Unit test writing

Fast Development process
When using dependency injection node developer can faster their development proceess because after DI there is less code conflict and easy to manage all module.

Decoupling
Modules becomes less couple then it is easy to maintain.

Unit test writing
Hardcoded dependencies can pass them into the module then easy to write unit test for each module.