A modern, lightweight implementation of dependency injection inspired by JSR-330 and Spring.
The library makes it possible to:
- define components and manage their lifecycle
- inject said components as dependencies
This loose coupling tends to make code more self-contained and easier to test, as injected components can be mocked to exhibit the behavior required for each test.
- Application Context
- Component Declaration
- Component Injection
- Component Lifecycle
- Component Scope
- Constant Injection
- Annotation-Based Configuration
The library can be installed using npm
:
npm install @es-injection/core --save
Or using yarn
:
yarn add @es-injection/core
The modules can be built using the following command:
yarn run build
Tests are written using Jest and can be kept running as a background task with:
yarn run test:watch