Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 1.05 KB

File metadata and controls

42 lines (26 loc) · 1.05 KB

koa-multipart-form

Koa middleware handling multipart/form-data.

When use it?

You can use this module if you need your Koa app to parse 'multipart/form-data'.

Features

Parses requests having type: 'multipart/form-data' and set ctx.body with the parsed stream.

Install

npm install @sigfox/koa-multipart-form

Usage

koaMultipartForm(options)

  • options (Object) (default: {}) You can either decide to pass an object that will be used as options for formidable.IncomingForm or the instance of it directly:
    • Object: The options that will be passed to IncomingForm.
    • instance of formidable.IncomingForm: The instance of IncomingForm that will be used for multipart processing.
const Koa = require('koa');
const koaMultipartForm = require('koa-multipart-form');

const app = new Koa().use(koaMultipartForm()).listen();

Test

npm test

Licence

This project is licensed under the MIT License - see the LICENSE file for details.