Elestia Open Source Ratings
5.2

injection-js

Reasonable, with limits. 4th of 7 dependency injection.

injection-js is a small, standalone copy of Angular's old ReflectiveInjector for use outside Angular. It is stable and safe, but it has had no commits in a year. It is mostly installed as a dependency of ng-packagr, and InversifyJS, TSyringe and Awilix are better choices for most new projects.

Best for: Developers who know Angular and want the same provider-and-injector model in a small Node or browser app.

GitHubnpm

Scores

Overall5.2

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 4.5, likely 3.5 to 5.5

It is a sound, small Angular-style injector, but development has stalled and it offers less than InversifyJS, TSyringe or Awilix. Its large download count comes from ng-packagr, not from developers choosing it. Keep it where it runs, or pick it only if you want Angular's exact provider model. Otherwise choose a peer.

GPT-6.2 Sol: 5.9, likely 4.8 to 7.0

Choose injection-js when Angular-style child injectors and decorator-free `inject()` are a close fit for how the app wires services. Awilix is a stronger starting point for Node.js services that need request scopes and disposal, and it has a more active release record. Slow maintenance and below-baseline download growth weigh on the recommendation, while continued use in ng-packagr gives the current API a track record.

Needed by many3.8

How many developers need a tool for this job?

Claude Opus 5.5: 3.5, likely 2.5 to 4.5

Few JavaScript developers use a DI container at all. Most rely on module imports or framework DI such as Angular's or NestJS's. injection-js works on any runtime, but it appeals mainly to people who already know Angular.

  • github.com/mgechev/injection-js: Aimed at Node, Vue, React and vanilla JS outside Angular
  • JS DI usage: DI containers are a niche in JS outside Angular and NestJS

GPT-6.2 Sol: 4.1, likely 2.8 to 5.5

A standalone container is most useful when an app has enough services and configuration to make manual wiring cumbersome. injection-js works in browsers and Node.js, and its provider model is especially familiar to Angular developers. Surveys give context on JavaScript app architecture, while demand for a standalone container is estimated from developer reports.

Helps a lot6.2

How well does it do the job for those who need it?

Claude Opus 5.5: 5.5, likely 4.5 to 6.5

It is a well-tested, complete copy of Angular's reflective DI. It has typed tokens, providers, child injectors and, since recently, inject() without decorators. It lacks the async providers, lifecycle scopes and module system that InversifyJS or Awilix offer. The decorator path still depends on legacy reflect-metadata settings.

GPT-6.2 Sol: 6.8, likely 5.8 to 7.9

Version 2.6.1 covers common provider patterns and hierarchical lookup, and field injection works without decorator metadata. Users report weak `Injector.get()` inference and setup friction with direct TypeScript runners. Modern Angular examples can mislead coding agents because this package exposes a smaller API. A competing library's benchmarks show mixed performance across workloads.

Holds up over time4.1

Will it still be a good choice in two years?

Claude Opus 5.5: 4.0, likely 3.0 to 5.5

The last release, 2.6.1, came out in October 2025. Since then there have been no commits, and the OpenSSF Maintained check scores 0. One maintainer releases it. ng-packagr depends on it, which makes abandonment less likely, but there is no sign of active development.

GPT-6.2 Sol: 4.1, likely 2.9 to 5.6

The project went a full year without a commit or npm release, and its two open user reports date to November 2025 and March 2026. npm lists one collaborator, while Awilix continued shipping in 2026. The long-lived 2.x API and ongoing use in ng-packagr give it some staying power, with future maintenance uncertain.

Used widely4.7

How many use it, and is that growing?

Claude Opus 5.5: 4.5, likely 3.5 to 5.5

It has 7.1M downloads in 4 weeks, but most of them come from ng-packagr in Angular library builds. Its year-over-year ratio of 1.8 is well below the 4.1 median, so it is losing ground. It has 13.6k dependent repos, but many probably arrive through ng-packagr, so direct choices are likely in the low thousands.

GPT-6.2 Sol: 4.9, likely 3.8 to 6.1

Ecosyste.ms found 13,633 dependent repositories, more than TSyringe and Awilix and fewer than InversifyJS in the same index. Its 7.13 million four-week downloads include installs pulled in by ng-packagr, so the number of direct choices is uncertain. Downloads reached 1.82 times the year-earlier figure, the slowest growth in this peer set and below the 4.1 times catalog median.

  • dependents repos and packages: The partial index found 13,633 repositories and 180 npm packages.
  • npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, and medianDownloadsRatio: Downloads grew from 3.93 million to 7.13 million, below the catalog growth baseline.
  • github.com/ng-packagr/ng-packagr/blob/main/package.json: Angular packaging tooling pulls it in as a dependency.
  • github stars, bluesky posts, and peers: 1,377 stars trail four peers, and three Bluesky posts tie TSyringe at the top of a sparse field.
Vouched for4.8

Who stands behind it being good?

Claude Opus 5.5: 4.0, likely 3.0 to 5.0

The strongest backing is that ng-packagr, the Angular team's library build tool, runs on it. It has no Hacker News stories, little independent write-up, and no presence in surveys. Users mostly describe it as simple and fine.

GPT-6.2 Sol: 5.6, likely 4.4 to 6.8

ng-packagr uses injection-js to wire its build pipeline, giving it a current example of use in widely deployed tooling. The Codefast benchmark provides a recent external comparison on one Node.js setup. Evidence from recent app deployments and developer satisfaction surveys is limited.

Safe6.8

How safe is it to depend on?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

It has no advisories ever, a single dependency (tslib) and an MIT licence on npm, so the attack surface is small. The OpenSSF Scorecard is 1.9: it has no branch protection, security policy or SAST, and the License check fails. One person publishes it, which concentrates risk.

  • advisories total: 0 advisories
  • npm dependencies: 1 dependency
  • scorecard score: 1.9, with weak branch protection, security policy and code review
  • npm license: MIT

GPT-6.2 Sol: 6.5, likely 5.2 to 7.8

Version 2.6.1 declares a permissive MIT licence, has one runtime dependency and ships without install scripts. OSV and Snyk list no known advisories for the current release. The OpenSSF score of 1.9 reflects weak code-review coverage, no detected branch protection and no published security policy. Publishing appears concentrated in one account, and the release provenance and speed of a future security response are unclear.

Good

  • It uses Angular's familiar provider model (useClass, useValue, useFactory, tokens) and supports child injectors.
  • It has an inject() field-initializer API, so you can use it without legacy TypeScript decorators.
  • It is tiny, with only one dependency and no known advisories.
  • The Angular team's ng-packagr runs on it, so it is exercised heavily in real builds.

Bad

  • There have been no commits or releases in the last year, and one person maintains it.
  • Decorator-based use needs reflect-metadata, experimentalDecorators and emitDecoratorMetadata.
  • Angular itself deprecated the ReflectiveInjector this library copies, and the library offers no async providers or rich scoping.
  • Its downloads come mostly from ng-packagr installs, not from people choosing it, and they grow more slowly than the median.

The numbers

npm downloads, 4 weeks
7.1M +82% in a year
GitHub stars
1.4k
Commits, 12 months
0
npm version
2.6.1 Oct 2025
Versions, 12 months
0
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
1.9 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (mgechev/injection-js), npm (injection-js), OSV and the OpenSSF Scorecard.

Dependency injection

  1. 7.5Awilix
  2. 7.4InversifyJS
  3. 6.3Needle DI
  4. 5.2injection-js
  5. 5.2TSyringe
  6. 4.7Brandi
  7. 3.1TypeDI
Compare all 7 on six scores