Installations
npm install koa-bodyparser-secure
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
0.12.7
NPM Version
2.12.1
Score
68.1
Supply Chain
92.7
Quality
74.3
Maintenance
50
Vulnerability
100
License
Contributors
Unable to fetch Contributors
Languages
JavaScript (91.15%)
Makefile (8.85%)
Developer
ptariche
Download Statistics
Total Downloads
2,399
Last Day
1
Last Week
1
Last Month
4
Last Year
57
GitHub Statistics
62 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
422.28 kB
Minified
179.48 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.0.0
Package Id
koa-bodyparser-secure@3.0.0
Size
3.54 kB
NPM Version
2.12.1
Node Version
0.12.7
Total Downloads
Cumulative downloads
Total Downloads
2,399
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
33.3%
4
Compared to previous month
Last year
-60.7%
57
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
koa-bodyparser
a body parser for koa, base on co-body.
Install
Usage
1var koa = require('koa'); 2var bodyParser = require('koa-bodyparser'); 3 4var app = koa(); 5app.use(bodyParser()); 6 7app.use(function *() { 8 // the parsed body will store in this.request.body 9 // if nothing was parsed, body will be an empty object {} 10 this.body = this.request.body; 11});
Options
-
encode: requested encoding. Default is
utf-8
byco-body
-
formLimit: limit of the
urlencoded
body. If the body ends up being larger than this limit, a 413 error code is returned. Default is56kb
-
jsonLimit: limit of the
json
body. Default is1mb
-
strict: when set to true, JSON parser will only accept arrays and objects. Default is
true
. See strict mode inco-body
-
detectJSON: custom json request detect function. Default is
null
1app.use(bodyparser({ 2 detectJSON: function (ctx) { 3 return /\.json$/i.test(ctx.path); 4 } 5}));
-
extendTypes: support extend types:
1app.use(bodyparser({ 2 extendTypes: { 3 json: ['application/x-javascript'] // will parse application/x-javascript type body as a JSON string 4 } 5}));
-
onerror: support custom error handle, if
koa-bodyparser
throw an error, you can customize the response like:1app.use(bodyparser({ 2 onerror: function (err, ctx) { 3 ctx.throw('body parse error', 422); 4 } 5}));
Licences
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-06
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