Socket
Socket
Sign inDemoInstall

response-time

Package Overview
Dependencies
Maintainers
6
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

response-time - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

6

HISTORY.md

@@ -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 @@

4

package.json
{
"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 @@

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