koa-json-body
Advanced tools
Comparing version 5.0.0 to 5.1.0
{ | ||
"name": "koa-json-body", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "koa middleware to parse json request bodies", | ||
@@ -33,3 +33,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"koa": ">= 2.0.0", | ||
"koa": "next", | ||
"mocha": "^2.3.3", | ||
@@ -39,4 +39,4 @@ "supertest": "^1.1.0" | ||
"peerDependencies": { | ||
"koa": ">= 2.0.0" | ||
"koa": "next" | ||
} | ||
} |
@@ -12,7 +12,2 @@ koa-json-body | ||
NOTE | ||
---- | ||
This branch is for koa v2, which uses Promises instead of Generator functions. For koa 0.x and 1.x support, see the [koa-1](https://github.com/venables/koa-json-body/tree/koa-1) branch. | ||
Installation | ||
@@ -42,4 +37,4 @@ ------------ | ||
app.use(function *() { | ||
console.log(this.request.body); | ||
app.use(function(ctx, next) { | ||
console.log(ctx.request.body); | ||
}); | ||
@@ -53,7 +48,13 @@ ``` | ||
app.post('/users', jsonBody, function *() { | ||
console.log(this.request.body); | ||
app.post('/users', jsonBody, function(ctx, next) { | ||
console.log(ctx.request.body); | ||
}); | ||
``` | ||
Made for koa 2 | ||
-------------- | ||
For koa 0.x and 1.x support, see the [koa-1](https://github.com/venables/koa-json-body/tree/koa-1) branch. | ||
Versioning | ||
@@ -60,0 +61,0 @@ ---------- |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61
3942