If you&#x27;re doing node-style (cjs) modules, you can use something like proxyquire[1] with testing to inject dependencies without complicating your modules, or creating logical indirection.  If the only reason you have DI is for testing in a scripted platform, you&#x27;re probably doing something wrong.<p>You can write, compose and composite plain objects and pure functions in JS modules that can be tested very easily without resorting to complex DI systems (with naming disconnects even).<p>[1] <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;proxyquire" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;proxyquire</a>