Yieldless
Native async/await primitives for tuple-based errors, structured concurrency, and Node/Electron workflows.
Yieldless is a TypeScript library with zero dependencies. It gives you tuple-based errors, structured concurrency, and resource management — built on Promise, AbortController, AsyncLocalStorage, and Symbol.asyncDispose.
Quick install
pnpm add yieldlessWhat it looks like
import { safeTry } from "yieldless/error";
import { runTaskGroup } from "yieldless/task";
const [repoError, repo] = await safeTry(loadRepository(repoId));
if (repoError) {
return [repoError, null] as const;
}
return await runTaskGroup(async (group) => {
const refs = group.spawn((signal) => loadRefs(repo.path, signal));
const status = group.spawn((signal) => loadStatus(repo.path, signal));
return {
repo,
refs: await refs,
status: await status,
};
});What Yieldless covers
Yieldless is intentionally modular. You can adopt one boundary at a time:
errorandresultfor tuple creation, folding, and compositiontask,all,iterable,queue,pubsub, andlimiterfor async coordination and load controlretry,schedule,signal,timer, andbreakerfor resilient boundariescache,batcher, andsingleflightfor repeated, keyed, and duplicate workfetch,node,event, andipcfor common platform boundariesschema,env, androuterfor application edgesresource,di,context, andtestfor lifecycle, ergonomics, and deterministic tests
Start with Beginner Tutorial if you are new to Yieldless, Simple Recipes if you want a small copy-pasteable pattern, or Module Selection if you are deciding which piece to reach for first.