npm.io
2.0.24 • Published 11 months ago

@types/koa-json

Licence
MIT
Version
2.0.24
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

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

/* =================== 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 0441 GMT
  • Dependencies: @types/koa

Credits

These definitions were written by Alex Friedman.