Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 0.0.3 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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc