@js-injection/service-provider
v1.1.0
Published
A lightweight, type-safe dependency injection container
Maintainers
Readme
Type-Safe Dependency Injection Container
A lightweight, fully type-safe Dependency Injection (DI) container for TypeScript. Designed for reliability, developer experience, and minification safety.
Table of Contents
Overview
This project provides a DI container that leverages TypeScript's type system to ensure that your dependencies are always resolved correctly. It focuses on a "Pure DI" approach, where dependencies are ideally resolved at the composition root.
Key Features
- Strict Type Safety: Full Intellisense and compile-time validation for all registered services.
- Multiple Lifetimes: Support for
Singleton(global) andScoped(per-context) services. - Async Support: Seamless integration with asynchronous factories and functions, including async disposal.
- Circular Dependency Detection: Detects circular dependencies during resolution.
- Minification Proof: Built-in stable identity system ensures that resolution by Class reference works even when class names are mangled.
- Zero Runtime Dependencies: A lean implementation with no external dependencies.
Development
- Build:
npm run bundle - Test:
npm test - Smoke Tests:
npm start(Runs end-to-end scenarios against bundled code)
License
Licensed under ISC.
Copyright © 2026+ contributors

