Message from JavaScript discussions

August 2018

— Browser will scale it automaticly


Hello, Can someone help-me about the Dependency Injection in Nodejs ?
What is the best pattern for this ?
what is the best module for use ?

Thank you!

— Dependency injection is a pattern

— You don't need modules

— You go from:
(dependencies) -> yourModule

— The purpose of dependency injection is in most cases testability, so you really only need to inject dependencies that talk to the outside world (console, network, db, fs)

Message permanent page

— It's the case, Is for testability

— I undestand

— That's all you need

— Instead of using require inside the module file, you do it outside the module and pass it in

— And for testing, you pass something else in

— Thank you TRGWII