{"library":"koa-json","type":"library","category":null,"description":"koa-json is a Koa middleware designed to pretty-print JSON responses and convert Node.js object streams into binary output. While the package itself, currently at version `2.0.2`, was last updated in April 2016, it remains functional and compatible with recent Koa versions (2.x and 3.x) which utilize async/await middleware. It serves a specific utility by automatically formatting `ctx.body` objects into human-readable, indented JSON, offering options to control pretty-printing behavior via a query string parameter or global configuration. This differentiates it from `koa-bodyparser`, which handles parsing incoming JSON requests. Due to its long-standing stability and the specialized nature of its function, the project's release cadence is effectively dormant, but it continues to be a viable option for adding structured JSON output to Koa applications.","language":"javascript","status":"maintenance","version":"2.0.2","tags":["javascript","koa","json"],"last_verified":"Wed May 27","install":[{"cmd":"npm install koa-json","imports":["import json from 'koa-json';","const json = require('koa-json');","app.use(json({ pretty: true, spaces: 2 }));"]},{"cmd":"yarn add koa-json","imports":[]},{"cmd":"pnpm add koa-json","imports":[]}],"homepage":null,"github":"https://github.com/koajs/json","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/koa-json","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/koa-json/compatibility"}}