Skip to content

diWiring checked by TypeScript

Define the capabilities your application needs, bind them at one edge, and compose modules whose missing dependencies are compile errors.

di beetroot logodi beetroot logo

Use di on its own ​

@btravstack/di works without the btravstack application kernel or a server runtime. Install the container and its unthrown peer dependency:

sh
pnpm add @btravstack/di unthrown

A port names a capability in your application's vocabulary. A provider constructs it, and a module chooses which ports the rest of the application can see. Module.scoped builds the graph, runs work with its typed context, and closes the scope.

The DI tutorial starts from an empty TypeScript project. For a larger application with production and in-memory adapters, see the hexagonal example. The complete exported surface is in the API reference.

Released under the MIT License.