corie-body-parser

1.0.0 • Public • Published

corie-body-parser

npm package

Note: wrap formidable as a middleware for koa2.

如果该插件对您的开发有所帮助,请五星好评哦!^^ ^^ ^_^


Table of contents


Installation

npm install --save corie-body-parser
 
# or 
 
cnpm install --save corie-body-parser

Usage

 
const Koa = require('koa');
const middleware = require('corie-body-parser');
 
const app = new Koa();
app.use(middleware({
    // ... 参数设置
}));
 

Options explanation:

  • encoding 设置表单字段的编码
  • uploadDir 设置上传后的文件存放的目录, 默认为: os.tmpdir()
  • keepExtensions 设置上传后的文件是否保持原来的扩展名
  • type multipart or urlencoded
  • maxFieldsSize 设置提交到后台数据的大小, 默认为: 20MB
  • maxFileSize 设置上传文件的大小, 默认为: 200MB
  • maxFields 设置url后面可接收的参数, 默认为: 1000
  • hash 使用sha1 or md5校验文件

Go to formidable API


Examples

Follow below links to learn more

Readme

Keywords

Package Sidebar

Install

npm i corie-body-parser

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.47 kB

Total Files

3

Last publish

Collaborators

  • fengxinming