Koa Query Parameter Pagination Middleware

JSON →
library 1.3.2 ·javascript maintenance
verified May 27, 2026

koa-pagination-v2 is a middleware designed for Koa applications to simplify handling pagination logic based on `page` and `limit` query parameters from the request. Currently at version 1.3.2, this package was last published approximately four years ago, indicating it is in a maintenance state rather than active development, with no recent releases or active contribution. Unlike its predecessor or other Koa pagination libraries that might focus on HTTP Range headers (e.g., the original `koa-pagination`), this version specifically processes `page` and `limit` from the URL query string. It exposes computed `limit` and `offset` values, along with a `pageable` helper function, via `ctx.state.paginate`. These values are directly usable with common ORMs (like Sequelize, as shown in the examples) to fetch a subset of data, and the `pageable` function helps construct comprehensive pagination metadata for API responses, including total count, page count, and navigation links. Its key differentiator is its straightforward, query-parameter-based approach, making it easy to integrate for simple REST API pagination.

total hits 32
actors 7 distinct systems
last hit 1d ago Amazonbot
MetaBot
4
GPTBot
2
Script
1
Amazonbot
1
Search engines
1
Humans
2

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇳🇴 Norway · 🇩🇪 Germany · 🇫🇷 France