Examples
Every example below lives in examples/ in the repository, is fully self-contained (its own package.json, its own README), and was verified to actually run — not just type-check.
Basic
registerInstance + resolve. The smallest possible TinyDI program.
View exampleService
IMailService / GraphApiMailService, comparing registerInstance and registerFactory.
View exampleRepository Pattern
IUserRepository / UserRepository / UserService — composing multiple dependencies.
View exampleNode Backend
Logger, repository and service layer composed through the container, served over plain Node HTTP.
View exampleVue
Using the container in Vue via provide/inject.
View exampleNuxt
A Nuxt plugin (plugins/di.ts) exposing the container as $container.
View exampleReact
A React Context Provider and a useService hook.
View example