Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino-http

Package Overview
Dependencies
Maintainers
4
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-http - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

6

logger.js

@@ -31,4 +31,4 @@ 'use strict'

function onResFinished (err) {
this.removeListener('error', onResFinished)
this.removeListener('finish', onResFinished)
this.removeListener('error', onResFinished)

@@ -38,6 +38,6 @@ var log = this.log

if (err) {
if (err || this.err || this.statusCode >= 500) {
log.error({
res: this,
err: err,
err: err || this.err || new Error('failed with status code' + this.statusCode),
responseTime: responseTime

@@ -44,0 +44,0 @@ }, 'request errored')

{
"name": "pino-http",
"version": "3.0.1",
"version": "3.1.0",
"description": "High-speed HTTP logger for Node.js",

@@ -5,0 +5,0 @@ "main": "logger.js",

@@ -212,2 +212,18 @@ 'use strict'

setTimeout(function () {
res.err = new Error('Some error')
res.emit('finished')
res.end()
}, 100)
}
expectResponseTime(t, dest, logger, handle)
})
test('responseTime for request emitting error event', function (t) {
var dest = split(JSON.parse)
var logger = pinoHttp(dest)
function handle (req, res) {
logger(req, res)
setTimeout(function () {
res.emit('error', new Error('Some error'))

@@ -214,0 +230,0 @@ res.end()

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