Can someone suggest a simple dependency injection library for TypeScript/JavaScript?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/typescript

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Sonar - Write Clean JavaScript Code. Always.
  • InfluxDB - Access the most powerful time series database as a service
  • tsyringe

    Lightweight dependency injection container for JavaScript/TypeScript

    Coming from a mostly Java background and using Spring often I was curious to try out DI in node on a personal project. I found tsyringe made by Microsoft to be pretty easy to use https://github.com/microsoft/tsyringe

  • koin

    Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform

    I've been using Angular a lot and I like how it works. I'm also a huge fan of koin for kotlin.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • awilix

    Extremely powerful Inversion of Control (IoC) container for Node.JS

    I used awilix in several project, seems good enough for us, no problem so far. https://github.com/jeffijoe/awilix

  • diod

    A very opinionated inversion of control (IoC) container and dependency injector for Typescript, Node.js or browser apps.

    I will suggest DIOD https://github.com/artberri/diod which is specially designed for Typescript, although it can be used with vanilla JS also.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts