Intro
Iti is 1kB Typesafe dependency injection framework for TypeScript and JavaScript with a unique support for async flow
This library doesn't try be scientifically correct. I just want to go home early
Features
- supports async(!) dependencies: merges async code and constructor injection via plain async functions
- strongly typed: has great IDE autocomplete and compile time check. Without any manual type casting
- non-invasive: does not require imported
@decorators
or frameworkextends
in your application business logic - lazy: initializes your app modules and containers on demand
- split chunks: enables dynamic imports via a one liner thanks to a fully async core
- React friendly: has useful React bindings to help you separate application business logic and a React view layer
- starter friendly: works with starters like Create React App or Next.js unlike existing libraries
- no Babel config: doesn't require
reflect-metadata
or decorators so there is no need to hack in decorator and"decoratorMetadata"
support in to your build configs - tiny: less than 1kB
IoC is an amazing pattern and it should easy to adopt, fully support async and without hard to learn APIs or complex tooling requirements.
Iti relies on plain JS functions, objects and familiar patterns. API is simple so you can make a proof of concept integration in minutes.
It is an alternative to InversifyJS and microsoft/tsyringe for constructor injection.
At Packhelp we’ve refactored most of our 65K SLOC Editor app, that didn't have any IoC, to Iti in under 5 hours