# Effection — Structured Concurrency for JavaScript > Effection is a JavaScript library for building reliable asynchronous and > concurrent programs using structured concurrency. Effection models async work as **lazy operations** with explicit lifetimes, deterministic cancellation, and guaranteed cleanup. It uses **generator functions (`function*`)**, not `async` / `await`, to express long-lived, cancellable work. --- ## IMPORTANT FOR AI AGENTS If you will **write, modify, refactor, or debug Effection code**, you **must** read [AGENTS.md] first. **AGENTS.md is the normative behavioral contract.** - Do not invent APIs - Do not infer semantics from Promises or other ecosystems - Do not substitute primitives that "look equivalent" - If information is missing or uncertain, consult the API reference If any other document conflicts with AGENTS.md, **AGENTS.md takes precedence**. --- ## Where to look (routing) - **Behavioral rules & invariants (authoritative):** [AGENTS.md] - **Public API reference (authoritative):** [API] - **Conceptual guides & explanations (human-oriented):** [Guides] - [Thinking in Effection] - [Async Rosetta Stone] - [Operations] - [Scope] - [Resources] - [Spawn] - [Collections] - [Browse all guides][docs/] --- ## EffectionX Packages Extension packages for common JavaScript tasks. Install from npm (`@effectionx/*`) or JSR (`jsr:@effectionx/*`). - [@effectionx/bdd](https://frontside.com/effection/x/bdd): A BDD (Behavior-Driven Development) testing harness for Deno that integrates seamlessly with Effection operations. - [@effectionx/chain](https://frontside.com/effection/x/chain): There are some use-cases for Promise for which there is not a 1:1 analogue in Effection. - [@effectionx/context-api](https://frontside.com/effection/x/context-api): Often called "Algebraic Effects" or "Contextual Effects", Context apis let you access an operation via the context in... - [@effectionx/converge](https://frontside.com/effection/x/converge): Recognize a desired state and synchronize on when that state has been achieved. - [@effectionx/effect-ts](https://frontside.com/effection/x/effect-ts): Bidirectional interop between Effect-TS and Effection. - [@effectionx/fs](https://frontside.com/effection/x/fs): File system operations for Effection programs. - [@effectionx/fx](https://frontside.com/effection/x/fx): A collection of utility functions to streamline asynchronous workflows. - [@effectionx/jsonl-store](https://frontside.com/effection/x/jsonl-store): JSONL Streaming Store provides an easy way to store documents in JSONL files. - [@effectionx/node](https://frontside.com/effection/x/node): Node. - [@effectionx/process](https://frontside.com/effection/x/process): Execute and manage system processes with structured concurrency. - [@effectionx/raf](https://frontside.com/effection/x/raf): Subscribe to a stream of Request Animation Frame updates. - [@effectionx/scope-eval](https://frontside.com/effection/x/scope-eval): Evaluate Effection operations in a scope while retaining resources. - [@effectionx/signals](https://frontside.com/effection/x/signals): Collection of immutable state containers for primitive data types. - [@effectionx/stream-helpers](https://frontside.com/effection/x/stream-helpers): A collection of type-safe stream helpers built on top of Effection for efficient and controlled stream processing. - [@effectionx/stream-yaml](https://frontside.com/effection/x/stream-yaml): A helper that parses a stream of strings as YAML documents. - [@effectionx/task-buffer](https://frontside.com/effection/x/task-buffer): Manages concurrent task execution by enforcing a maximum limit on simultaneously active operations. - [@effectionx/test-adapter](https://frontside.com/effection/x/test-adapter): An abstract helper for integrating Effection with testing frameworks. - [@effectionx/timebox](https://frontside.com/effection/x/timebox): Constrain any operation to complete within a certain time. - [@effectionx/tinyexec](https://frontside.com/effection/x/tinyexec): Effection compatible wrapper around tinyexec package. - [@effectionx/vitest](https://frontside.com/effection/x/vitest): Adapter to add an effection scope to the test suite to allow writing a function* () {} test function. - [@effectionx/watch](https://frontside.com/effection/x/watch): Watch is a very simple tool that does one thing: run a command, and every time source files change in a directory, sh... - [@effectionx/websocket](https://frontside.com/effection/x/websocket): A streamlined WebSocket client for Effection programs that transforms the event-based WebSocket API into a clean, res... - [@effectionx/worker](https://frontside.com/effection/x/worker): Easily use Web Workers to offload CPU-intensive computations or manage external processes. ## Optional - [Full EffectionX catalog with documentation](https://frontside.com/effection/x/) - [Effection Blog](https://frontside.com/effection/blog) --- [AGENTS.md]: https://raw.githubusercontent.com/thefrontside/effection/v4/AGENTS.md [API]: https://frontside.com/effection/api/ [Guides]: https://frontside.com/effection/guides/v4 [Thinking in Effection]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/thinking-in-effection.mdx [Async Rosetta Stone]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/async-rosetta-stone.mdx [Operations]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/operations.mdx [Scope]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/scope.mdx [Resources]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/resources.mdx [Spawn]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/spawn.mdx [Collections]: https://raw.githubusercontent.com/thefrontside/effection/v4/docs/collections.mdx