# @serverless-devs/http-json-body-parser

> Fc 函数计算的参数格式为`(req, res, context)`。第一个参数 req 的参数类型为 readable Stream。将 req 转换为 JSON Object 的类型

Latest version **0.0.4-alpha.38** (published 2021-08-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @serverless-devs/http-json-body-parser
pnpm add @serverless-devs/http-json-body-parser
yarn add @serverless-devs/http-json-body-parser
bun add @serverless-devs/http-json-body-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4-alpha.38 |
| Published | 2021-08-16 |
| First published | 2021-05-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | serverlessfans, heimanba, xsahxl |

## Links

- npm: https://www.npmjs.com/package/@serverless-devs/http-json-body-parser
- npm.io page: https://npm.io/package/@serverless-devs/http-json-body-parser

## Dependencies (1)

- [http-errors](https://npm.io/package/http-errors.md) ^1.8.0

## Recent versions

- 0.0.4-alpha.38 (latest) — 2021-08-16
- 0.0.4-alpha.37 — 2021-08-10
- 0.0.4-alpha.36 — 2021-08-09
- 0.0.4-alpha.35 — 2021-08-06
- 0.0.4-alpha.34 — 2021-08-04
- 0.0.4-alpha.32 — 2021-08-02
- 0.0.4-alpha.31 — 2021-07-27
- 0.0.4-alpha.29 — 2021-07-19
- 0.0.4-alpha.28 — 2021-07-14
- 0.0.4-alpha.27 — 2021-07-12
- 0.0.4-alpha.26 — 2021-07-07
- 0.0.4-alpha.24 — 2021-06-30
- 0.0.4-alpha.23 — 2021-06-28
- 0.0.4-alpha.18 — 2021-06-25
- 0.0.4-alpha.17 — 2021-06-21
- … 10 more at https://npm.io/package/@serverless-devs/http-json-body-parser/versions

## README

## 设计原则

Fc 函数计算的参数格式为`(req, res, context)`。第一个参数 req 的参数类型为 readable Stream。将 req 转换为 JSON Object 的类型

## 基础使用方式

```javascript
'use strict';
const dk = require('@serverless-devs/dk-core');
const jsonBodyParser = require('@serverless-devs/http-json-body-parser');

const handler = dk((request) => {
  return { body: 'hello world' };
});

handler.use(jsonBodyParser());

exports.handler = handler;
```

## 高级使用方式

---
_Source: https://npm.io/package/@serverless-devs/http-json-body-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
