Gathering detailed insights and metrics for koa-get-body
Gathering detailed insights and metrics for koa-get-body
Gathering detailed insights and metrics for koa-get-body
Gathering detailed insights and metrics for koa-get-body
A body parser for koa2, support urlencoded, multipart and json
npm install koa-get-body
Typescript
Module System
Node Version
NPM Version
68.5
Supply Chain
83
Quality
75.1
Maintenance
50
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
7,650
Last Day
1
Last Week
6
Last Month
29
Last Year
425
2 Stars
11 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jan 27, 2023
Minified
Minified + Gzipped
Latest Version
1.1.2
Package Id
koa-get-body@1.1.2
Size
3.40 kB
NPM Version
5.2.0
Node Version
7.7.3
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
100%
6
Compared to previous week
Last Month
-37%
29
Compared to previous month
Last Year
8.7%
425
Compared to previous year
A body parser for koa2, support urlencoded
, multipart
, json
,text
and xml
(need option xmlParser
configured).
(return raw body for non-supported mime types)
1npm install koa-get-body
1const Koa = require('koa') 2const getBody = require('koa-get-body') 3 4let app = new Koa() 5app.use(getBody()) 6app.use(async ctx => { 7 const body = await ctx.request.getBody() 8 // or get a single field 9 const name = await ctx.request.getBody('name') 10})
1app.use(getBody({
2 alias: 'getPost', // alias func name on `ctx',
3 uploadDir: '/path/to/your/dir/',
4 xmlParser: utils.paserXML, // see https://github.com/yangg/koa-get-body/blob/master/spec/utils.js
5 getFileName: (fieldName) => {
6 return shortid.generate()
7 },
8 limits: {
9 fileSize: Infinity,
10 // ...
11 }
12}))
13app.use(async ctx => {
14 const body = await ctx.getPost() // get body via alias `getPost'
15})
ctx
, then you can use ctx.aliasName()
json
, see type-is, default: ['json', '+json']
, the following mime types will matched: application/json
, application/vnd.api+json
, application/json-patch+json
text
, default: text/*
xml
, default: xml
os.tmpdir()
[]
or [name]
)MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
project is archived
Details
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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