UNPKG

@types/koa-json

Version:
50 lines (37 loc) 1.26 kB
# Installation > `npm install --save @types/koa-json` # Summary This package contains type definitions for koa-json (https://github.com/koajs/json). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-json. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-json/index.d.ts) ````ts /* =================== USAGE =================== import * as Koa from 'koa'; import * as json from 'koa-json'; const app = new Koa(); app.use(json()); =============================================== */ import Koa = require("koa"); declare function json(opts?: { /** * default to pretty response [true] */ pretty?: boolean | undefined; /** * optional query-string param for pretty responses [none] */ param?: string | undefined; /** * JSON spaces [2] */ spaces?: number | undefined; }): Koa.Middleware; declare namespace json {} export = json; ```` ### Additional Details * Last updated: Fri, 24 Oct 2025 04:02:41 GMT * Dependencies: [@types/koa](https://npmjs.com/package/@types/koa) # Credits These definitions were written by [Alex Friedman](https://github.com/brooklyndev).