Gathering detailed insights and metrics for @koa/multer
Gathering detailed insights and metrics for @koa/multer
Gathering detailed insights and metrics for @koa/multer
Gathering detailed insights and metrics for @koa/multer
npm install @koa/multer
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
170 Stars
94 Commits
26 Forks
4 Watching
2 Branches
19 Contributors
Updated on 23 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
5.1%
15,231
Compared to previous day
Last week
5.1%
80,801
Compared to previous week
Last month
3.8%
336,346
Compared to previous month
Last year
45.8%
3,571,736
Compared to previous year
Route middleware for Koa that handles
multipart/form-data
using multer
This module is a fork of koa-multer, the most widely used multer middleware in the koa community. Due to lack of maintenance, it was forked to the official Koa organization and is available under @koa/multer
package name.
Note that you must install either
multer@1.x
(Buffer) ormulter@2.x
(Streams):
1npm install --save @koa/multer multer
1const Koa = require('koa'); 2const Router = require('@koa/router'); 3const multer = require('@koa/multer'); 4 5const app = new Koa(); 6const router = new Router(); 7const upload = multer(); // note you can pass `multer` options here 8 9// add a route for uploading multiple files 10router.post( 11 '/upload-multiple-files', 12 upload.fields([ 13 { 14 name: 'avatar', 15 maxCount: 1 16 }, 17 { 18 name: 'boop', 19 maxCount: 2 20 } 21 ]), 22 ctx => { 23 console.log('ctx.request.files', ctx.request.files); 24 console.log('ctx.files', ctx.files); 25 console.log('ctx.request.body', ctx.request.body); 26 ctx.body = 'done'; 27 } 28); 29 30// add a route for uploading single files 31router.post( 32 '/upload-single-file', 33 upload.single('avatar'), 34 ctx => { 35 console.log('ctx.request.file', ctx.request.file); 36 console.log('ctx.file', ctx.file); 37 console.log('ctx.request.body', ctx.request.body); 38 ctx.body = 'done'; 39 } 40); 41 42// add the router to our app 43app.use(router.routes()); 44app.use(router.allowedMethods()); 45 46// start the server 47app.listen(3000);
Name | Website |
---|---|
Nick Baugh | http://niftylettuce.com/ |
Imed Jaberi | https://www.3imed-jaberi.com/ |
MIT © Fangdun Cai
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 3/10 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More