Awilix
A strong pick. 1st of 7 dependency injection.
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
Overall7.5
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 7.0, likely 6.0 to 8.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.
- peers commitsLastYear: Peers show 0 to 20 commits, Awilix 68
- npm-compare.com/awilix,inversify,tsyringe,typedi: Recommended as the balanced decorator-free option
- docs.medusajs.com/advanced/backend/dependency-container: Used in production by Medusa
GPT-6.2 Sol: 7.9, likely 6.8 to 8.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.
- github.com/jeffijoe/awilix: Documents decorator-free registration, scoping, and disposal.
- inversify.io/docs/api/container: Documents a peer's built-in async resolution.
- github.com/medusajs/medusa/pull/17574: Shows recent adoption of the current major by a downstream framework.
- github.com/fastify/fastify-awilix: Shows a maintained integration for Fastify.
- socket.dev/npm/package/awilix/overview/13.0.3: The package snapshot lists one maintainer.
- npm versionsLastYear, downloadsLast4Weeks, and downloadsSame4WeeksYearAgo; medianDownloadsRatio; scorecard score: Active npm publishing, below-baseline install growth, and weak repository controls.
Needed by many4.4
How many developers need a tool for this job?
Claude Opus 5.5: 4.5, likely 3.5 to 5.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.
- github description: Describes itself as an IoC container for Node.JS
- unpkg.com/awilix@13.0.5/README.md: Browser builds exist, but loadModules works only in Node
GPT-6.2 Sol: 4.3, likely 3.0 to 5.8
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.
- survey.stackoverflow.co/2026/technology/data: 46.4% of respondents to the web technology question reported using Node.js.
- github.com/jeffijoe/awilix: Documents browser builds, Node.js module loading, and service lifetimes.
- reddit.com/r/typescript/comments/1lbfv3u/which_di_library: Developers discuss containers and explicit wiring for growing Node.js apps.
Helps a lot7.9
How well does it do the job for those who need it?
Claude Opus 5.5: 7.5, likely 6.5 to 8.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.
- unpkg.com/awilix@13.0.5/README.md: Lifetimes, strict mode, disposal, ESM, and the bundler limits of loadModules
- npm-compare.com/awilix,inversify,tsyringe,typedi: Comparison says it gives the best balance without forcing decorators
- npm hasTypes: Ships TypeScript types
GPT-6.2 Sol: 8.2, likely 7.1 to 9.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.
- github.com/jeffijoe/awilix: Documents registration, scopes, strict mode, errors, and the async initialization add-on.
- github.com/jeffijoe/awilix/blob/master/CHANGELOG.md: v13 infers types across chained registrations.
- inversify.io/docs/api/container: InversifyJS 8 documents native async resolution through getAsync.
- github.com/codefastlabs/codefast/blob/main/benchmarks/di/RESULTS.md: A competing maintainer's reproducible Node.js suite tests Awilix 13.0.5.
Holds up over time7.2
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 5.5 to 8.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.
- github commitsLastYear: 68 commits, against 0 to 20 for the peers
- npm versionsLastYear: 10 versions, latest 13.0.7 on 2026-11-16
- github openIssues: 1 open and 278 closed issues
- maintainer: Mostly a single-maintainer project
GPT-6.2 Sol: 7.4, likely 6.1 to 8.5
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.
- github commitsLastYear and releasesLastYear: 68 commits and zero GitHub Releases.
- npm versionsLastYear and latestPublishedAt: 10 npm versions and a November 16, 2026 publish.
- github.com/jeffijoe/awilix/blob/master/CHANGELOG.md: Records TypeScript changes and the higher Node.js minimum.
- github.com/jeffijoe/awilix/issues/418: The owner responded and committed a fix on the day of the report.
- socket.dev/npm/package/awilix/overview/13.0.3: The package snapshot lists one maintainer.
Used widely4.5
How many use it, and is that growing?
Claude Opus 5.5: 5.0, likely 4.0 to 6.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).
- npm downloadsLast4Weeks: 3.59M, up from 1.10M a year ago, a ratio of 3.26 against the 4.1 median
- dependents: 2,071 repositories and 442 packages, behind most large peers
- github stars: 4,246 stars
- bluesky posts: 1 post, low attention
GPT-6.2 Sol: 3.9, likely 2.8 to 5.2
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.
- npm downloadsLast4Weeks and downloadsSame4WeeksYearAgo; medianDownloadsRatio: 3.26× year over year against a 4.1× catalog baseline.
- dependents and peers dependentRepos: 2,071 indexed repos versus 17,579 for InversifyJS, 6,704 for TSyringe, and 2,751 for TypeDI.
- github stars, bluesky posts, and hackerNews stories: 4,246 stars, one Bluesky post, and no matched Hacker News stories.
- github.com/medusajs/medusa/pull/17574: Medusa's dependency on Awilix can generate installs without a direct choice.
Vouched for6.5
Who stands behind it being good?
Claude Opus 5.5: 5.5, likely 4.5 to 7.0
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.
- docs.medusajs.com/advanced/backend/dependency-container: Medusa uses Awilix for its DI container
- npmjs.com/package/@fastify/awilix: Official Fastify plugin built on Awilix
- dev.to/lucasprochnow/dependency-injection-di-with-nodejs-typescript-5f25: Developer write-up using Awilix
- hackerNews stories: No HN stories
GPT-6.2 Sol: 7.5, likely 6.2 to 8.6
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.
- github.com/medusajs/medusa/pull/17574: Medusa merged its upgrade to Awilix 13.0.5 in November 2026.
- github.com/fastify/fastify-awilix: Fastify's integration implements request scopes and disposal.
- reddit.com/r/typescript/comments/1lbfv3u/which_di_library: A developer reports years of use and recommends it over two peers.
- github.com/codefastlabs/codefast/blob/main/benchmarks/di/RESULTS.md: Recent comparative tests show a small bundle and mixed evidence for a performance recommendation.
Safe6.7
How safe is it to depend on?
Claude Opus 5.5: 7.0, likely 6.0 to 8.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.
- advisories total: 0 advisories
- npm dependencies: 1 dependency
- scorecard score: 3.2, with Code-Review 1, Branch-Protection 0 and Security-Policy 0
- npm license: MIT
GPT-6.2 Sol: 6.3, likely 5.0 to 7.6
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.
- npm license and dependencies; advisories total: MIT, one direct dependency, and zero OSV advisories.
- scorecard score and checks: Weak repository controls, with packaging and signed releases unscored.
- github.com/jeffijoe/awilix/blob/master/package.json: Names fast-glob and shows the npm publishing scripts.
- github.com/jeffijoe/awilix/security: GitHub shows no security policy or published advisories.
- socket.dev/npm/package/awilix/overview/13.0.3: The package snapshot lists one maintainer.
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
- npm downloads, 4 weeks
- 3.6M ×3.3 in a year
- GitHub stars
- 4.2k
- Commits, 12 months
- 68
- npm version
- 13.0.7 Nov 2026
- Versions, 12 months
- 10
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 3.2 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (jeffijoe/awilix), npm (awilix), OSV and the OpenSSF Scorecard.