@sigfox/koa-multipart-form

Koa middleware handling multipart/form-data.

Usage no npm install needed!

<script type="module">
  import sigfoxKoaMultipartForm from 'https://cdn.skypack.dev/@sigfox/koa-multipart-form';
</script>

README

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.