ozaco is a set of runtime-agnostic TypeScript packages: an effect system with real task supervision, results instead of thrown exceptions, and an IO layer that runs the same on Bun, Node and the Web.
Four properties the runtime holds, and the API that gives each one — guarantees about shape, not speed.
An operation settles as a Result. Nothing is thrown, so the type says what can go wrong.
isFailure(result)A spawned task cannot outlive its scope. Closing one halts its children and waits for them.
yield* spawn(worker)Cleanup is registered on the way in. It runs however the body leaves — return, failure or halt.
yield* ensure(close)The same code on Bun, Node and the Web. The backend is picked at the import, not in your logic.
@ozaco/std/io/impl/bunOperations are generators, failures are values, and every task belongs to a scope that outlives it. Play it through — the console on the left prints what the runtime does, and every snippet is lifted from a passing test.
const result = await run(function* () {
const value = yield* call(() => Promise.resolve(21))
return value * 2
})
@ozaco/std/io is the contract; an implementation entry point binds it to a host. Your operations never name a runtime.
@ozaco/std/io/impl/bunBun.file, Bun.write, Bun’s spawn
@ozaco/std/io/impl/nodenode:fs/promises and node:child_process
@ozaco/std/io/impl/webfetch, streams and the origin’s storage
Each package is independent on npm and documented module by module. They share the standard library’s effect system, result type and IO contract.
The foundation every other package builds on.
Service core, transports, resilience policies, gateways and plugins.
Command parsing, prompts, spinners, tables and a terminal palette.
Schema, migrations and query layer with SQLite and Postgres impls.
Provider-agnostic AI client with an OpenAI implementation.
Build/resolve helpers, a client generator and ambient import aliases.
Everything else — the server, the CLI, the database layer — is built on the same effect system and the same result type.
bun add @ozaco/std