within-ts

Getting Started

An Effect-like library using async/await instead of generators

What is within-ts?

within-ts is an Effect-like library — same ideas, but using async/await instead of generators. No wrapper types, no lazy computation graphs. Just regular TypeScript with better patterns for errors, services, and more.

If you've ever wanted the power of Effect but didn't want to learn a new programming model, within-ts is for you. Everything is plain TypeScript. Functions return normal values. Errors are just classes. Dependencies flow through AsyncLocalStorage instead of effect systems.

Install

npm install within-ts
pnpm add within-ts
yarn add within-ts
bun add within-ts

Philosophy

Read one section at a time. Don't move on until it clicks.

Each piece is independent — you can use tagged errors without services, or Result without the logger. But they're designed to work together. Services power the logger. Result powers the scheduler. Tagged errors make Result useful. The whole is greater than the parts.

On this page