# koajs/compose

Middleware composition utility

Repository: https://github.com/koajs/compose
Canonical: https://ross.abutalabs.com/products/koajs-compose
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-04-02T08:06:13+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 75, release rhythm 35, longevity 100
- inputs: {"age_days": 4768, "days_push": 153, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1020, forks 144 (observed 2026-08-28T04:03:15.239110+00:00)

## What it is
koa-compose is a small utility that composes an array of Koa middleware into a single middleware function using the onion model. It is the core composition engine used by the Koa web framework.

## Use cases
- compose koa middleware into one function
- chain async middleware with onion model
- reuse middleware outside of koa
- build custom middleware pipelines in node.js
- understand how koa middleware execution works

## When to choose
- you are building or extending a Koa application
- you need promise-based middleware composition in Node.js
- you want a tiny dependency-free composition utility

## When to avoid
- you use Express or another framework with its own middleware system
- you need framework features beyond composition
- you are not working in a Node.js/JavaScript environment

## Facets
- artifact type: library
- maturity: stable
- function: middleware, web-framework
- domain: web-development, backend, developer-tools
- platform: -
- tags: koa, middleware-composition, onion-model, async, nodejs, javascript

## Member repositories
- koajs/compose (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:15.239110+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:09:18.036550+00:00, confidence not recorded.
  - readme: https://github.com/koajs/compose (fetched 2026-08-28T04:03:15.239110+00:00, sha 999ca5ac4692)
- Data as of 2026-08-30T08:39:29.467469+00:00.
