# Awilix: 7.5 out of 10

A strong pick. 1st of 7 in [Dependency injection](https://elestia.ai/opensource/di/index.md).

Awilix is a mature IoC container for Node.js that needs no decorators. It resolves dependencies by name and offers scoped lifetimes, strict mode, auto-loading of modules and disposal. It is the most actively maintained container in this category and a strong pick for decorator-free backend code, though one person does most of the work.

**Best for:** Node.js backend teams that want per-request scoped dependency injection without decorators, reflect-metadata or compiler settings.

## Scores

- **Overall: 7.5** (likely 6.4 to 8.5)
  - Claude Opus 5.5 (7.0): Awilix is well designed and the best-maintained container in a category where InversifyJS, TSyringe and TypeDI show few or no commits in the last year. That makes it a strong pick for decorator-free Node backends. Its reach and validation are modest, it has one maintainer, and its string-keyed API gives less type safety. These keep it out of the 9–10 band.
  - GPT-6.2 Sol (7.9): Awilix is a strong pick for Node.js services that want decorator-free wiring, request scopes, and straightforward cleanup. Active npm maintenance and adoption by Medusa and Fastify support choosing it today. InversifyJS has an edge for teams that need built-in async resolution. Concentrated publishing access, weak repository controls, and below-baseline download growth limit confidence in Awilix as the category-wide default.
- **Needed by many: 4.4** (likely 3.3 to 5.7)
  - Claude Opus 5.5 (4.5): Explicit DI containers are mostly used in larger Node.js backends. Many JS developers never use one, or use the DI built into a framework such as NestJS or Angular. Awilix works in browsers too, but it targets Node.
  - GPT-6.2 Sol (4.3): Awilix fits JavaScript and TypeScript applications with enough services or lifetimes to justify a container. It has a browser build, although its module discovery is geared toward Node.js. The Stack Overflow survey shows a large Node.js audience, and the share that needs a separate container is unclear.
- **Helps a lot: 7.9** (likely 6.8 to 8.9)
  - Claude Opus 5.5 (7.5): It is a complete container: three lifetimes, scopes, strict mode, disposal, ESM module loading, and bundled types. It needs no decorators. Its limits are string-keyed resolution with weaker type checking than typed-inject-style containers, PROXY magic, and a loadModules that bundlers cannot use. Independent comparisons praise its balance of simplicity and power.
  - GPT-6.2 Sol (8.2): The core handles classes, factories, scopes, and disposal, with clear resolution errors and optional lifetime checks. The examples give developers and coding agents a clear registration pattern, and v13 improves type inference, though missing registrations can still fail at runtime. InversifyJS has built-in async resolution, while Awilix documents a separate package for async initialization. A competing library's benchmark found slower Awilix resolution on its test workloads, leaving application-level performance uncertain.
- **Holds up over time: 7.2** (likely 5.8 to 8.3)
  - Claude Opus 5.5 (7.0): It is the most active project in the category: 68 commits and 10 npm versions in the last year, a push the day before this review, and 1 open issue against 278 closed. It has been maintained steadily for ten years. The main risk is that the author, Jeff Hansen, carries most of the work. Medusa and Fastify depend on it, which gives the ecosystem a reason to keep it alive.
  - GPT-6.2 Sol (7.4): Awilix recorded 68 commits and 10 npm versions in the past year, including 13.0.7 on November 16. A reported Jest and esbuild regression got a same-day fix, and v13 changed TypeScript defaults and raised the Node.js minimum. Socket listed one package maintainer, and funding and backup publishing access are unclear. That concentration limits confidence in the two-year outlook.
- **Used widely: 4.5** (likely 3.4 to 5.6)
  - Claude Opus 5.5 (5.0): It has 3.6M downloads in 4 weeks, but much of that comes from Medusa installs. Its yearly ratio of 3.3 is below the 4.1 median, so it is losing ground relative to the field. Its 2,071 dependent repositories trail InversifyJS (17.6k), injection-js (13.6k), TSyringe (6.7k) and TypeDI (2.8k).
  - GPT-6.2 Sol (3.9): Four-week downloads rose from 1.10 million to 3.59 million, or 3.26×, below the catalog's 4.1× baseline. Ecosyste.ms found 2,071 repositories and 442 packages, with InversifyJS, TSyringe, and TypeDI all ahead on indexed repository count. About 4,250 stars show established interest, while recent social attention is sparse. Automated installs, framework dependencies, and partial repository coverage make the number of direct choices uncertain.
- **Vouched for: 6.5** (likely 5.4 to 7.8)
  - Claude Opus 5.5 (5.5): Medusa, a well-known commerce framework, builds its container on Awilix, and the Fastify organisation maintains an official plugin for it. Beyond that, the evidence is tutorials and auto-generated comparisons. There is no survey data or independent benchmark.
  - GPT-6.2 Sol (7.5): Medusa uses Awilix for its container and recently merged an upgrade to v13. Fastify maintains an integration with request scopes and cleanup. A long-time user reports preferring it to TSyringe and InversifyJS, though that report and the available benchmarks provide limited evidence about satisfaction across teams.
- **Safe: 6.7** (likely 5.5 to 7.8)
  - Claude Opus 5.5 (7.0): It has no known advisories, only 1 runtime dependency, and an MIT licence. The OpenSSF Scorecard is low at 3.2: no branch protection, almost no code review, no security policy, and broad token permissions. That weak process with a single publisher is the main supply-chain risk.
  - GPT-6.2 Sol (6.3): Awilix uses the permissive MIT licence, has one direct runtime dependency, and has no recorded OSV advisories. OpenSSF Scorecard gives it 3.2 out of 10, with weak code review and zero scores for branch protection, workflow token permissions, and a security policy. The documented release scripts run npm publish, and a package snapshot lists one maintainer. Release signing and provenance remain unverified.

## Good

- Needs no decorators or reflect-metadata, so it works with plain TypeScript, ESM and bundled code.
- Scoped, singleton and transient lifetimes, with a strict mode that catches lifetime mismatches. This suits per-request scopes well.
- Actively maintained, with 68 commits and 10 npm versions in the last year and only 1 open issue.
- Proven in production as the container inside Medusa, with an official Fastify plugin.

## Bad

- Registrations are keyed by strings, so its type safety is weaker than that of compile-time-checked containers.
- The default PROXY mode and name-based resolution feel implicit, and CLASSIC mode breaks under minification.
- loadModules depends on globs and does not work in Webpack, Rollup or Browserify builds.
- One maintainer and a low OpenSSF Scorecard of 3.2, with no branch protection and almost no code review.

## The numbers

- Downloads, 4 weeks: 3.6M
- In a year: ×3.3
- GitHub stars: 4.2k
- Commits, 12 months: 68
- Last npm release: Nov 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/jeffijoe/awilix
- npm: https://www.npmjs.com/package/awilix

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
