@types/koa-bodyparser

  • Version 4.3.1
  • Published
  • 8.11 kB
  • 1 dependency
  • MIT license

Install

npm i @types/koa-bodyparser
yarn add @types/koa-bodyparser
pnpm add @types/koa-bodyparser

Overview

TypeScript definitions for koa-bodyparser

Index

Functions

function bodyParser

bodyParser: (opts?: bodyParser.Options) => any;

    Interfaces

    interface Options

    interface Options {}

      property detectJSON

      detectJSON?: (ctx: Koa.Context) => boolean;
      • custom json request detect function. Default is null

      property enableTypes

      enableTypes?: string[];
      • parser will only parse when request type hits enableTypes, default is ['json', 'form'].

      property encode

      encode?: string;
      • requested encoding. Default is utf-8 by co-body

      property extendTypes

      extendTypes?: {
      json?: string[];
      form?: string[];
      text?: string[];
      };
      • support extend types

      property formLimit

      formLimit?: string;
      • limit of the urlencoded body. If the body ends up being larger than this limit a 413 error code is returned. Default is 56kb

      property jsonLimit

      jsonLimit?: string;
      • limit of the json body. Default is 1mb

      property onerror

      onerror?: (err: Error, ctx: Koa.Context) => void;
      • support custom error handle

      property strict

      strict?: boolean;
      • when set to true, JSON parser will only accept arrays and objects. Default is true

      property textLimit

      textLimit?: string;
      • limit of the text body. Default is 1mb.

      Package Files (1)

      Dependencies (1)

      Dev Dependencies (0)

      No dev dependencies.

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/koa-bodyparser.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/koa-bodyparser)
      • HTML
        <a href="https://www.jsdocs.io/package/@types/koa-bodyparser"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>