Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Angular
  3. injection-js

injection-js

TypeScript

A lightweight, feature-complete dependency injection library for JavaScript and TypeScript, extracted from Angular's DI system.

GitHubGitHub
1.4k stars68 forks0 contributors

What is injection-js?

Injection-js is a dependency injection library for JavaScript and TypeScript, extracted from Angular's ReflectiveInjector. It enables developers to manage and inject dependencies in applications outside of the Angular ecosystem, providing a lightweight, reliable solution for projects using Node.js, Vue, React, or vanilla JavaScript. The library solves the problem of needing a robust DI system without the overhead of Angular's full framework.

Target Audience

Developers building applications in JavaScript or TypeScript who need a mature dependency injection system, particularly those working with Node.js, Vue, React, or vanilla JS projects where Angular's DI is not available.

Value Proposition

Developers choose Injection-js because it offers Angular's battle-tested dependency injection in a minimal package, ensuring high reliability and feature completeness without framework lock-in. Its small size and compatibility with various environments make it a versatile choice for managing dependencies efficiently.

Overview

Dependency injection library for JavaScript and TypeScript in 5.1K. It is an extraction of the Angular's ReflectiveInjector which means that it's well designed, feature complete, fast, reliable and well tested.

Use Cases

Best For

  • Adding dependency injection to Node.js applications
  • Managing dependencies in Vue or React projects without Angular
  • Using TypeScript with a robust DI system outside Angular
  • Implementing inversion of control in vanilla JavaScript applications
  • Migrating from Angular's ReflectiveInjector to standalone projects
  • Building modular applications with hierarchical injectors

Not Ideal For

  • Projects requiring compile-time dependency injection without runtime reflection
  • Environments where adding Reflect API polyfills is impractical or prohibited
  • Teams using modern Angular (version 5+) who prefer StaticInjector for consistency
  • Small, single-file scripts or prototypes where DI overhead outweighs benefits

Pros & Cons

Pros

Angular's Proven DI

Extracted from Angular's ReflectiveInjector, offering a mature, feature-complete, and well-tested dependency injection system inherited from Angular's rigorous design.

Minimal Footprint

Weighs only about 5.2KB, adding negligible size to bundles while providing full DI functionality, making it efficient for various projects.

Broad Environment Support

Works with Node.js, Vue, React, TypeScript, and vanilla JavaScript, as shown in the README examples, ensuring versatility across different frameworks.

Hierarchical Injection

Supports child injectors and hierarchical dependency management, enabling modular application design similar to Angular's DI patterns.

Cons

Reflection Dependency

Requires polyfills like reflect-metadata for ES5 and TypeScript, adding setup complexity and potential performance overhead in environments without native Reflect support.

Deprecated API Basis

Built on Angular's deprecated ReflectiveInjector, which contrasts with modern Angular's static injection and may not align with current best practices or receive updates.

Documentation Limitations

Relies on Angular's documentation from older versions (e.g., v4), which may not fully address non-Angular use cases or provide tailored guidance for other frameworks.

Frequently Asked Questions

Quick Stats

Stars1,378
Forks68
Contributors0
Open Issues2
Last commit11 months ago
CreatedSince 2017

Tags

#dependency-injection#decorators#inversion-of-control#nodejs#typescript#node#javascript#react#vue

Included in

Angular10.0k
Auto-fetched 1 day ago

Related Projects

@joanpablo/reactive_forms@joanpablo/reactive_forms

This is a model-driven approach to handling form inputs and validations, heavily inspired in Angular's Reactive Forms

Stars504
Forks111
Last commit9 months ago
reaktivreaktiv

Signals for Python - Reactive Declarative State Management Library for Python - automatic dependency tracking and reactive updates for your application state. Inspired by Angular Signals / SolidJS.

Stars457
Forks10
Last commit3 months ago
needle-dineedle-di

A lightweight, type-safe Dependency Injection (DI) library for JavaScript and TypeScript projects

Stars142
Forks11
Last commit1 month ago
flexdiflexdi

Framework-agnostic dependency injection that adapts to your favorite UI library

Stars47
Forks2
Last commit24 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub