This page is also available in Italiano.

Continua in italiano

Installation

TinyDI ships as a single package with zero runtime dependencies. Install it with your package manager of choice.

Install via npm

bash
npm install tinydi-container

The same package works with pnpm add tinydi-container, yarn add tinydi-container, or bun add tinydi-container — there is nothing npm-specific about it.

Requirements

Nothing else to install

TinyDI has zero runtime dependencies. After installing it, npm ls tinydi-container pulls in nothing beyond the package itself.

Module format

TinyDI ships as a dual ESM/CommonJS package (built with tsup), tree-shakable, with a single entry point exporting everything you need: Container, createToken, ServiceLifetime, and the error classes.

ts
import { Container, createToken, ServiceLifetime } from 'tinydi-container';
to navigate to select Esc to close