response-time
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -0,1 +1,7 @@ | ||
2.2.0 / 2014-09-22 | ||
================== | ||
* Add `suffix` option | ||
* deps: depd@~1.0.0 | ||
2.1.0 / 2014-09-16 | ||
@@ -2,0 +8,0 @@ ================== |
12
index.js
@@ -45,2 +45,7 @@ /*! | ||
// display suffix | ||
var suffix = options.suffix !== undefined | ||
? Boolean(options.suffix) | ||
: true | ||
return function responseTime(req, res, next) { | ||
@@ -56,4 +61,9 @@ var startAt = process.hrtime() | ||
var ms = diff[0] * 1e3 + diff[1] * 1e-6 | ||
var val = ms.toFixed(digits) | ||
this.setHeader(header, ms.toFixed(digits) + 'ms') | ||
if (suffix) { | ||
val += 'ms' | ||
} | ||
this.setHeader(header, val) | ||
}) | ||
@@ -60,0 +70,0 @@ |
{ | ||
"name": "response-time", | ||
"description": "Response time header for node.js", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -18,3 +18,3 @@ "contributors": [ | ||
"dependencies": { | ||
"depd": "0.4.5", | ||
"depd": "~1.0.0", | ||
"on-headers": "~1.0.0" | ||
@@ -21,0 +21,0 @@ }, |
@@ -40,2 +40,7 @@ # response-time | ||
##### suffix | ||
Boolean to indicate if units of measurement suffix should be added to | ||
the output, defaults to `true` (ex: `2.300ms` vs `2.300`). | ||
## Examples | ||
@@ -42,0 +47,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
6598
57
98
+ Addeddepd@1.0.1(transitive)
- Removeddepd@0.4.5(transitive)
Updateddepd@~1.0.0