~/ozaco
ozaco.com
// hero@ozaco/std v0.5.0
v0.5.0 · 6 packages

Structured concurrency,
typed failure, one runtime contract.

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.

01 / 07
design
// whycount: 4

Why ozaco

Four properties the runtime holds, and the API that gives each one — guarantees about shape, not speed.

01

Failures are values

An operation settles as a Result. Nothing is thrown, so the type says what can go wrong.

isFailure(result)
02

Tasks have an owner

A spawned task cannot outlive its scope. Closing one halts its children and waits for them.

yield* spawn(worker)
03

Teardown is armed, not remembered

Cleanup is registered on the way in. It runs however the body leaves — return, failure or halt.

yield* ensure(close)
04

One IO contract

The same code on Bun, Node and the Web. The backend is picked at the import, not in your logic.

@ozaco/std/io/impl/bun
03 / 07
concurrency
// effectsteps: 5

Concurrency you can follow

Operations 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.

1/5@ozaco/std/effect
01run
an operation is a generator, and it settles as a Result
logs03
entering the root scope
call() awaited inside the operation
settled Success(42)
effect.test.tsts
const result = await run(function* () {
  const value = yield* call(() => Promise.resolve(21))
  return value * 2
})
04 / 07
io
// runtimebackends: 3

Same code, three runtimes

@ozaco/std/io is the contract; an implementation entry point binds it to a host. Your operations never name a runtime.

Bun

@ozaco/std/io/impl/bun

Bun.file, Bun.write, Bun’s spawn

Node

@ozaco/std/io/impl/node

node:fs/promises and node:child_process

Web

@ozaco/std/io/impl/web

fetch, streams and the origin’s storage

05 / 07
npm
// startone command

Start with the standard library

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
read the docs
07 / 07
ozaco.com
~/ozaco

Runtime-agnostic TypeScript packages, published to npm.

MIT