CAF (Cancelable Async Flows) is a small utility that brings cooperative cancellation to JavaScript async workflows. It wraps async generators or promise-returning functions so they can respond to a cancel signal and halt work early, preventing wasted CPU and stray side effects. The library encourages a disciplined pattern: pass a token into your task, periodically check it, and unwind gracefully when cancellation is requested. This approach avoids brittle timeouts and “fire-and-forget” leaks by making cancellation a first-class concern. CAF is framework-agnostic and pairs well with fetch, timers, or custom async primitives, giving you a consistent contract for stopping in-flight operations. ...