connect-timeout
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -0,1 +1,9 @@ | ||
1.6.0 / 2015-02-15 | ||
================== | ||
* deps: http-errors@~1.3.1 | ||
- Construct errors using defined constructors from `createError` | ||
- Fix error names that are not identifiers | ||
- Set a meaningful `name` property on constructed errors | ||
1.5.0 / 2014-12-30 | ||
@@ -2,0 +10,0 @@ ================== |
{ | ||
"name": "connect-timeout", | ||
"description": "timeout middleware", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"contributors": [ | ||
@@ -13,3 +13,3 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
"debug": "~2.1.1", | ||
"http-errors": "~1.2.8", | ||
"http-errors": "~1.3.1", | ||
"ms": "0.7.0", | ||
@@ -16,0 +16,0 @@ "on-headers": "~1.0.0" |
@@ -19,14 +19,25 @@ # connect-timeout | ||
**NOTE** This module is not recommend as a "top-level" middleware (i.e. `app.use(timeout('5s'))`) unless | ||
you take precautions to halt your own middleware processing. See [as top-level middleware](#as-top-level-middleware) | ||
**NOTE** This module is not recommend as a "top-level" middleware (i.e. | ||
`app.use(timeout('5s'))`) unless you take precautions to halt your own | ||
middleware processing. See [as top-level middleware](#as-top-level-middleware) | ||
for how to use as a top-level middleware. | ||
### timeout(time, options) | ||
### timeout(time, [options]) | ||
Returns middleware that times out in `time` milliseconds. `time` can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) module. On timeout, `req` will emit `"timeout"`. | ||
Returns middleware that times out in `time` milliseconds. `time` can also | ||
be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) | ||
module. On timeout, `req` will emit `"timeout"`. | ||
#### options | ||
#### Options | ||
* `respond` - If `true`, the timeout error is passed to `next()` so that you may customize the response behavior. This error has a `.timeout` property as well as `.status == 503`. This defaults to `true`. | ||
The `timeout` function takes an optional `options` object that may contain | ||
any of the following keys: | ||
##### respond | ||
Controls if this module will "respond" in the form of forwarding an error. | ||
If `true`, the timeout error is passed to `next()` so that you may customize | ||
the response behavior. This error has a `.timeout` property as well as | ||
`.status == 503`. This defaults to `true`. | ||
### req.clearTimeout() | ||
@@ -44,6 +55,7 @@ | ||
Because of the way middleware processing works, this once this module passes the request | ||
to the next middleware (which it has to do in order for you to do work), it can no longer | ||
stop the flow, so you must take care to check if the request has timedout before you | ||
continue to act on the request. | ||
Because of the way middleware processing works, this once this module | ||
passes the request to the next middleware (which it has to do in order | ||
for you to do work), it can no longer stop the flow, so you must take | ||
care to check if the request has timedout before you continue to act | ||
on the request. | ||
@@ -134,11 +146,11 @@ ```javascript | ||
[npm-image]: https://img.shields.io/npm/v/connect-timeout.svg?style=flat | ||
[npm-image]: https://img.shields.io/npm/v/connect-timeout.svg | ||
[npm-url]: https://npmjs.org/package/connect-timeout | ||
[travis-image]: https://img.shields.io/travis/expressjs/timeout.svg?style=flat | ||
[travis-image]: https://img.shields.io/travis/expressjs/timeout/master.svg | ||
[travis-url]: https://travis-ci.org/expressjs/timeout | ||
[coveralls-image]: https://img.shields.io/coveralls/expressjs/timeout.svg?style=flat | ||
[coveralls-image]: https://img.shields.io/coveralls/expressjs/timeout/master.svg | ||
[coveralls-url]: https://coveralls.io/r/expressjs/timeout?branch=master | ||
[downloads-image]: https://img.shields.io/npm/dm/connect-timeout.svg?style=flat | ||
[downloads-image]: https://img.shields.io/npm/dm/connect-timeout.svg | ||
[downloads-url]: https://npmjs.org/package/connect-timeout | ||
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg?style=flat | ||
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg | ||
[gratipay-url]: https://www.gratipay.com/dougwilson/ |
9069
154
+ Addedhttp-errors@1.3.1(transitive)
- Removedhttp-errors@1.2.8(transitive)
Updatedhttp-errors@~1.3.1