# think_payload

> Payload parser Middleware for ThinkKoa.

Latest version **3.1.0** (published 2020-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install think_payload
pnpm add think_payload
yarn add think_payload
bun add think_payload
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2020-05-10 |
| First published | 2017-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >8.0.0 |
| Dependencies | 7 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | richenlin |
| Maintainers | richenlin |

## Links

- npm: https://www.npmjs.com/package/think_payload
- Homepage: https://github.com/thinkkoa/think_payload
- Issues: https://github.com/thinkkoa/think_payload/issues
- npm.io page: https://npm.io/package/think_payload

## Dependencies (7)

- [xml2js](https://npm.io/package/xml2js.md) ^0.4.23
- [raw-body](https://npm.io/package/raw-body.md) ^2.4.1
- [inflation](https://npm.io/package/inflation.md) ^2.0.0
- [think_lib](https://npm.io/package/think_lib.md) ^2.x.x
- [formidable](https://npm.io/package/formidable.md) ^1.2.2
- [on-finished](https://npm.io/package/on-finished.md) ^2.3.0
- [think_logger](https://npm.io/package/think_logger.md) ^2.x.x

## Recent versions

- 3.1.0 (latest) — 2020-05-10
- 3.0.0 — 2020-04-30
- 2.3.0 — 2020-03-27
- 2.2.1 — 2020-02-28
- 2.1.1 — 2019-10-22
- 2.1.0 — 2019-10-22
- 2.0.6 — 2019-10-22
- 2.0.5 — 2019-06-06
- 2.0.4 — 2018-02-07
- 2.0.3 — 2018-02-07
- 2.0.2 — 2018-01-16
- 2.0.0 — 2017-11-16
- 1.2.0 — 2017-11-13
- 1.1.4 — 2017-09-27
- 1.1.3 — 2017-09-20
- … 9 more at https://npm.io/package/think_payload/versions

## README

# 介绍
-----

[![npm version](https://badge.fury.io/js/think_payload.svg)](https://badge.fury.io/js/think_payload)

Payload parser for ThinkKoa

# 安装
-----

```
npm i think_payload
```

# 使用
-----

1、payload中间件为thinkkoa内置中间件,无需在项目中创建引用。该中间件默认开启

2、项目中间件配置 config/middleware.js:
```
config: { //中间件配置
    ...,
    payload: {
        extTypes: {
            json: ['application/json'],
            form: ['application/x-www-form-urlencoded'],
            text: ['text/plain'],
            multipart: ['multipart/form-data'],
            xml: ['text/xml']
        }
        limit: '20mb',
        encoding: 'utf-8',
        //Sets the directory for placing file uploads in. You can move them later on using fs.rename(). The default is os.tmpdir().
        // uploadDir:  os.tmpdir(),
        //If you want checksums calculated for incoming files, set this to either 'sha1' or 'md5'.
        // hash: 'md5'
    }
}
```

---
_Source: https://npm.io/package/think_payload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
