A library for writing safe, concurrent, fault-tolerant programs in TypeScript.
-
Functional design
Effective.ts introduces anIO
monad, as used in Haskell and Cats Effect (Scala). This allows the manipulation of programs as values, using pure functions. This has a "fluent" method chaining interface, to make it idiomatic to TypeScript. -
Typed errors
TheIO
type tracks the possible errors which can be raised by an action, so you know exactly which error cases you need to handle. No nasty surprises! -
Concurrency and cancellation
Launch lightweight async fibers (green threads), with support for early cancellation. Easily run actions in parallel or in sequence. -
Fault-tolerance
In the real world, things fail, so effective.ts has built-in support for timeouts and retries with exponential backoff.
API reference documentation is hosted here.
If you are already familiar with using the IO types in Haskell or Scala, this cheat sheet should help you get up to speed with Effective.ts quickly.