Gathering detailed insights and metrics for koa-xml-body
Gathering detailed insights and metrics for koa-xml-body
Gathering detailed insights and metrics for koa-xml-body
Gathering detailed insights and metrics for koa-xml-body
npm install koa-xml-body
Typescript
Module System
Min. Node Version
Node Version
NPM Version
73.5
Supply Chain
88
Quality
72.9
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
732,993
Last Day
34
Last Week
2,292
Last Month
8,290
Last Year
101,973
MIT License
39 Stars
55 Commits
7 Forks
2 Watchers
4 Branches
3 Contributors
Updated on Dec 10, 2024
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
koa-xml-body@3.0.0
Unpacked Size
17.00 kB
Size
4.92 kB
File Count
9
NPM Version
8.1.0
Node Version
16.13.0
Published on
Jun 15, 2023
Cumulative downloads
Total Downloads
Last Day
-71.9%
34
Compared to previous day
Last Week
22.4%
2,292
Compared to previous week
Last Month
-6.9%
8,290
Compared to previous month
Last Year
-15.3%
101,973
Compared to previous year
Parse xml request body for Koa
1const koa = require('koa') 2const xmlParser = require('koa-xml-body') 3 4const app = koa() 5app.use(xmlParser()) 6 7app.use(function(ctx, next) { 8 // the parsed body will store in this.request.body 9 // if nothing was parsed, body will be undefined 10 ctx.body = ctx.request.body 11 return next() 12})
koa-xml-body
will carefully check and set context.request.body
, so it can intergate well with other body parsers such as koa-bodyparser
:
1// ... 2const bodyParser = require('koa-bodyparser') 3 4// ... 5app.use(xmlParser()) 6app.use(bodyParser())
Note:
koa@2.x
, use version 2.x
or 3.x
;koa@1.x
, use koa-xml-body@1.x
.utf8
. If not set, the lib will retrive it from content-type
(such as content-type:application/xml;charset=gb2312
).1mb
.content-length
is found, it will be overwritten automatically.None
. It means it will throws the error. You can config it to customize the response.{}
. See xml2js Options
for details.body (ctx.request.body)
.1app.use(xmlParser({
2 limit: 128,
3 encoding: 'utf8', // lib will detect it from `content-type`
4 xmlOptions: {
5 explicitArray: false
6 },
7 key: 'xmlBody', // lib will check ctx.request.xmlBody & set parsed data to it.
8 onerror: (err, ctx) => {
9 console.error(err);
10 ctx.throw(err.status, err.message);
11 }
12}))
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 2/8 approved changesets -- score normalized to 2
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
security policy file not detected
Details
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
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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