Comparing version 3.1.0 to 3.1.1
3.1.1 / 2016-03-04 | ||
================== | ||
* bump deps | ||
* simplify scripts | ||
3.1.0 / 2015-10-24 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/send", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"keywords": [ | ||
@@ -17,6 +17,6 @@ "koa", | ||
"devDependencies": { | ||
"istanbul-harmony": "0", | ||
"istanbul": "0", | ||
"koa": "1", | ||
"mocha": "2", | ||
"should": "7", | ||
"should": "8", | ||
"supertest": "1" | ||
@@ -28,10 +28,10 @@ }, | ||
"debug": "*", | ||
"mz": "^2.1.0", | ||
"resolve-path": "^1.3.0" | ||
"mz": "^2.3.1", | ||
"resolve-path": "^1.3.1" | ||
}, | ||
"scripts": { | ||
"test": "mocha --require should --reporter spec", | ||
"test-cov": "node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should", | ||
"test-travis": "node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --require should" | ||
"test-cov": "istanbul cover ./node_modules/.bin/_mocha -- --require should", | ||
"test-travis": "istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --require should" | ||
} | ||
} |
@@ -51,2 +51,21 @@ | ||
## Example (Koa@2) with async/await | ||
```js | ||
var send = require('koa-send'); | ||
var Koa = require('koa'); | ||
var app = new Koa(); | ||
// $ GET /package.json | ||
// $ GET / | ||
app.use(async function (ctx, next){ | ||
if ('/' == ctx.path) return ctx.body = 'Try GET /package.json'; | ||
await send(ctx, ctx.path); | ||
}) | ||
app.listen(3000); | ||
console.log('listening on port 3000'); | ||
``` | ||
## Example | ||
@@ -64,3 +83,3 @@ | ||
if ('/' == this.path) return this.body = 'Try GET /package.json'; | ||
yield send(this, __dirname + '/package.json'); | ||
yield send(this, this.path); | ||
}) | ||
@@ -67,0 +86,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
8992
109
Updatedmz@^2.3.1
Updatedresolve-path@^1.3.1