Async/Await & Generator Middleware Composition
JSON →The `composition` package provides a utility for composing asynchronous middleware functions in a manner similar to Koa. It uniquely supports mixing both traditional generator functions (using `yield next`) and modern `async/await` functions within the same middleware stack. Each composed middleware function is expected to return a Promise or handle `next()` correctly to ensure the control flow propagates. The package is currently at version 2.3.0, indicating a stable release focused on robust async control flow. While no explicit release cadence is documented, utilities of this nature tend to be stable with updates driven by significant changes in JavaScript's asynchronous patterns or bug fixes. Its key differentiator is the seamless interoperability between generator-based and promise-based async middleware, making it suitable for projects transitioning or requiring compatibility across different asynchronous programming styles.
Traffic · last 30 days ↓70% vs prev 7d
top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · TZ