BlueLibs Runner is a TypeScript-first dependency injection toolkit for building applications from small, typed building blocks.
What is BlueLibs Runner?
Runner is a dependency injection framework that helps you build maintainable TypeScript applications. Instead of wrestling with decorators or magic, you get explicit, testable code with powerful features built in. The goal is simple: keep dependencies explicit, keep lifecycle predictable, and make your runtime easy to control in production and in tests.Key features
Tasks
Async functions with explicit dependencies, middleware, and input/output validation using Zod or custom schemas
Resources
Singletons with
init/dispose lifecycle for databases, clients, servers, and cachesReliability middleware
Built-in
retry, timeout, circuitBreaker, cache, and rateLimit for production-grade resilienceHTTP tunnels
Cross-process execution (the “Distributed Monolith”) with zero call-site changes
Durable workflows
Persistent, crash-recoverable async logic for Node.js
Events & hooks
Typed signals and subscribers for decoupling components
Runtime control
Run, observe, test, and dispose your app predictably
Multi-platform
Works in Node.js, browsers, and edge runtimes with platform adapters
Quick example
Here’s what Runner looks like in action:Why Runner?
Explicit over magic: No decorators, no reflection, no hidden wiring. You see exactly what depends on what. Production-ready: Built-in middleware for retry, timeout, circuit breakers, rate limiting, and caching. No need to build these yourself. Test-friendly: Every component is isolated and composable. Override any dependency for testing without affecting your production code. Multi-platform: Write once, run anywhere. Runner works in Node.js, browsers, and edge runtimes with platform adapters.Platform support
| Capability | Node.js | Browser | Edge | Notes |
|---|---|---|---|---|
| Core runtime (tasks/resources/middleware/events/hooks) | Full | Full | Full | Platform adapters hide runtime differences |
Async Context (r.asyncContext) | Full | None | None | Requires Node.js AsyncLocalStorage |
Durable workflows (@bluelibs/runner/node) | Full | None | None | Node-only module |
Tunnels client (createHttpClient) | Full | Full | Full | Requires fetch |
Tunnels server (@bluelibs/runner/node) | Full | None | None | Exposes tasks/events over HTTP |
Next steps
Quick start
Get up and running in 5 minutes
Installation
Detailed setup and prerequisites
Tasks
Learn about business logic with DI
Resources
Manage singletons with lifecycle