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 8.2.0 to 8.2.1

10

index.d.ts

@@ -13,3 +13,3 @@ // Project: https://github.com/pinojs/pino-http#readme

import pino from 'pino';
import { SerializedError, SerializedRequest, SerializedResponse } from 'pino-std-serializers';
import { err, req, res, SerializedError, SerializedRequest, SerializedResponse } from 'pino-std-serializers';

@@ -46,3 +46,3 @@ declare function PinoHttp(opts?: Options, stream?: pino.DestinationStream): HttpLogger;

export interface GenReqId {
(req: IncomingMessage): ReqId;
(req: IncomingMessage, res: ServerResponse): ReqId;
}

@@ -63,2 +63,8 @@

export interface StdSerializers {
err: typeof err;
req: typeof req;
res: typeof res;
}
export interface StdSerializedResults {
err: SerializedError;

@@ -65,0 +71,0 @@ req: SerializedRequest;

16

index.test-d.ts

@@ -8,3 +8,4 @@

import { Writable } from 'stream';
import pinoHttp, { AutoLoggingOptions, CustomAttributeKeys, GenReqId, HttpLogger, Options, ReqId, startTime, StdSerializers } from '.';
import { err, req, res } from 'pino-std-serializers';
import pinoHttp, { AutoLoggingOptions, CustomAttributeKeys, GenReqId, HttpLogger, Options, ReqId, startTime, StdSerializers, StdSerializedResults } from '.';

@@ -16,5 +17,6 @@ const logger = pino();

pinoHttp({ logger }).logger = logger;
pinoHttp({ genReqId: (req: IncomingMessage) => req.statusCode || 200 });
pinoHttp({ genReqId: (req: IncomingMessage) => 'foo' });
pinoHttp({ genReqId: (req: IncomingMessage) => Buffer.allocUnsafe(16) });
pinoHttp({ genReqId: (req: IncomingMessage, res: ServerResponse) => req.statusCode || 200 });
pinoHttp({ genReqId: (req: IncomingMessage, res: ServerResponse) => res.statusCode || 200 });
pinoHttp({ genReqId: (req: IncomingMessage, res: ServerResponse) => 'foo' });
pinoHttp({ genReqId: (req: IncomingMessage, res: ServerResponse) => Buffer.allocUnsafe(16) });
pinoHttp({ useLevel: 'error' });

@@ -127,2 +129,8 @@ pinoHttp({ prettyPrint: true }); // deprecated but still present in pino.

const stdSerializers: StdSerializers = {
err: err,
req: req,
res: res
}
const stdSerializedResults: StdSerializedResults = {
err: {

@@ -129,0 +137,0 @@ type: 'type',

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

@@ -20,3 +20,3 @@ "main": "logger.js",

"pino-http-print": "^3.1.0",
"pino-pretty": "^8.0.0",
"pino-pretty": "^9.0.0",
"pre-commit": "^1.1.2",

@@ -27,3 +27,3 @@ "split2": "^4.0.0",

"ts-node": "^10.3.0",
"tsd": "^0.22.0",
"tsd": "^0.24.1",
"typescript": "^4.4.4"

@@ -30,0 +30,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