@kauai/body
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@kauai/body CI Status version Known Vulnerabilities Coverage Status code style: prettier semantic-release Conventional Commits GitHub top language node version npm downloads License

Kauai body parser middleware. Supports the following content types

  • application/json
  • application/x-www-form-urlencoded
  • plain/text

and any combination of the following encodings

  • br
  • x-gzip
  • gzip
  • deflate

Installation

npm install @kauai/body

Usage

import BodyParser from "@kauai/body";

class MyMiddleware extends Middleware {
  public run(context: Context): void {
    const { body } = context.request;
    context.log.info("Body has been parsed (or not)", { body });
  }
}

app.use("/deposit", new Router().post(new BodyParser(), new MyMiddleware()));

Test

npm run test:ci

Readme

Keywords

Package Sidebar

Install

npm i @kauai/body

Weekly Downloads

2

Version

1.0.1

License

AGPL-3.0-only

Unpacked Size

42.4 kB

Total Files

6

Last publish

Collaborators

  • b2broker-manager