Skip to content
Middleware for handling `multipart/form-data` for koa, based on Express's multer.
JavaScript
Branch: master
Clone or download
Latest commit a4618d0 Aug 6, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test 🚀 , #1 Nov 20, 2015
.gitignore init Apr 3, 2015
.travis.yml ci: node 6, 7, 8 Aug 6, 2017
History.md Release 1.0.0 Nov 24, 2015
LICENSE init Apr 3, 2015
README.md update Dec 15, 2015
index.js Only call wrapped function once Oct 2, 2016
package-lock.json Bump v1.0.2 Aug 6, 2017
package.json

README.md

koa-multer

Multer is a node.js middleware for handling multipart/form-data for koa.
multer wrapper for koa's middleware.

NPM version NPM Downloads Build status Test coverage Dependency status License

Install

$ npm install --save koa-multer

Usage

=1.x, 100%, working with multer-v1.x and koa-v2.x.

const Koa = require('koa');
const route = require('koa-route');
const multer = require('koa-multer');

const app = new Koa();
const upload = multer({ dest: 'uploads/' });

app.use(route.post('/profile', upload.single('avatar')));

app.listen(3000);

=0.x, working with multer-v0.x(v0.1.8 is the latset version of v0.x) and koa-v1.x

var koa = require('koa');
var multer = require('koa-multer');

var app = koa();

app.use(multer({ dest: './uploads/'}));

app.listen(3000);

License

MIT

You can’t perform that action at this time.