Skip to main content
1

Install

See the Installation page for yarn/pnpm commands and TypeScript requirements.
2

Your first Result

chas.fromPromise wraps any Promise and maps thrown errors into a typed value. The result is a ResultAsync<T, E> that’s awaitable, chainable, and explicit about what can go wrong.
3

Validate input with Guard

is from ts-chas/guard gives you chainable type predicates you can use inline or combine into full schemas.
4

A resilient Task

Task wraps an async operation lazily, which means it does not run until you call .execute(). You can attach retries, timeouts, and other resilience patterns before execution.
5

Putting it together

Here is a ~15-line end-to-end example that validates incoming request data with Guard, fetches a remote resource with Result, and wraps the whole thing in a resilient Task.
These examples only scratch the surface. Head to Core Concepts for a deeper dive into Result, Guard, Task, Tagged Errors, Option, and Pipe/Flow.