You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

koa-json-body

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-json-body - npm Package Compare versions

Comparing version

to
1.0.0

18

index.js
'use strict';
var coBody = require('co-body');
var parse = require('co-body');
var initialize = function(opts) {
opts = opts || {};
opts = opts || { strict: true };
return function *(next) {
this.request.body = {};
this.request.body = yield parse.json(this, opts);
this.body = this.request.body;
try {
if (this.is('application/json')) {
this.request.body = yield coBody.json(this, opts);
}
} catch(e) {
}
yield next;
}
}
};
};
module.exports = initialize;
{
"name": "koa-json-body",
"version": "0.0.3",
"version": "1.0.0",
"description": "koa middleware to parse json request bodies",

@@ -27,4 +27,4 @@ "main": "index.js",

"dependencies": {
"co-body": "^0.0.1"
"co-body": "^2.0.0"
}
}