0.7.0 • Published 2 years ago

koas-body-parser v0.7.0

Weekly downloads
507
License
MIT
Repository
gitlab
Last release
2 years ago

Koas Body Parser

Koas body parser parses and validates request bodies based on the current operation.

Installation

npm install koa koas-body-parser koas-core

Usage

const Koa = require('koa');
const { bodyParser } = require('koas-body-parser');
const { koas } = require('koas-core');

const api = require('./api.json');

const app = new Koa();
app.use(
  koas(api, [
    bodyParser({
      parsers: {
        // Parsers
      },
    }),
  ]),
);

Options

Koas body parser accepts a mapping of mime types to parser functions. Wildcard mime types are supported as well. The parsers for the following mime types are supported by default:

  • application/json
  • multipart/form-data
  • text/plain

Note: multipart/form-date is parsed entirely so it can be validated and used easily later on. If the request should be streamed instead, pass a custom multipart/form-data parser.

0.7.0

2 years ago

0.6.0

2 years ago

0.5.4

2 years ago

0.5.5

2 years ago

0.5.3

2 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.8

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago