Skip to content

InversifyJS

A lightweight dependency injection container for TypeScript and JavaScript apps.

Stars
12.1k
Forks
708
Licence
MIT
Language
TypeScript
Last update
12 months ago
Type
Library

What it is

InversifyJS is an inversion of control (IoC) container for TypeScript and JavaScript apps, including Node.js. It uses class constructors to identify and inject the dependencies a class needs, which helps developers write code that follows SOLID and other object-oriented design practices. The README says the project is moving to the inversify/monorepo repository, where future releases will be published.

  • Wiring service classes and their dependencies together in a Node.js application
  • Organizing a TypeScript codebase around injected interfaces instead of hard-coded instances
  • Swapping implementations of a dependency, such as for testing, through container configuration

Great for

  • TypeScript developers who want structured dependency injection in Node.js back-end code
  • Teams following SOLID or composition-based object-oriented design
  • Developers who want a small runtime footprint, as the project lists low runtime overhead as a goal

Not ideal for

  • Developers who want a complete application framework, since InversifyJS only provides the injection container itself
  • People new to dependency injection concepts, since the README assumes familiarity with OOP and IoC patterns
  • Projects that need active development in this repository, since the README says future work is moving to the monorepo
Step-by-step guide: how to use InversifyJSInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js · npm

    Clone the repository

    git clone https://github.com/inversify/InversifyJS
  2. 2

    Run it

    • Read the documentation at https://inversify.io
    • Install the inversify package from npm
    • Define interfaces and classes for your services
    • Bind them in a container and resolve your top-level class
  3. 3

    Get the most out of it

    • Follow the documentation at https://inversify.io for the full API
    • Watch the inversify/monorepo repository for future releases, as the README recommends

Downloads

Strengths

  • The README describes it as lightweight and focused on one job: dependency injection
  • It is written in TypeScript and aims to encourage good OOP and IoC practices
  • It has an MIT license and a documentation site at inversify.io

Trade-offs

  • The README says development is moving to a different repository, so users should check where updates now land
  • The README is truncated and gives little detail on specific APIs, so the actual feature set needs checking in the docs
  • The license copyright line only covers 2015-2017, so the project's full history of contributors should be checked before relying on that detail

How it compares

ProjectStarsTypeLevelUpdatedBest for
InversifyJS (this)12.1kLibraryintermediate12 months agoTypeScript developers who want structured dependency injection in Node.js back-end code
getx11.2kLibrarybeginner5 days agoFlutter developers who want state management, routing and dependency injection from a single package
effect17.5kLibraryadvanced4 days agoTeams building large or long-lived TypeScript back-end services

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.