Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@types/pino-http
Advanced tools
TypeScript definitions for pino-http
npm install --save @types/pino-http
This package contains type definitions for pino-http (https://github.com/pinojs/pino-http#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pino-http.
import { IncomingMessage, ServerResponse } from "http";
import { DestinationStream, Level, Logger, LoggerOptions } from "pino";
export = PinoHttp;
declare function PinoHttp(opts?: PinoHttp.Options, stream?: DestinationStream): PinoHttp.HttpLogger;
declare function PinoHttp(stream?: DestinationStream): PinoHttp.HttpLogger;
declare namespace PinoHttp {
interface HttpLogger {
(req: IncomingMessage, res: ServerResponse, next?: () => void): void;
logger: Logger;
}
type ReqId = number | string | object;
/**
* Options for pino-http
*
* See https://github.com/pinojs/pino-http#pinohttpopts-stream
*/
interface Options extends LoggerOptions {
logger?: Logger | undefined;
genReqId?: GenReqId | undefined;
useLevel?: Level | undefined;
stream?: DestinationStream | undefined;
autoLogging?: boolean | AutoLoggingOptions | undefined;
customLogLevel?: ((res: ServerResponse, error: Error) => Level) | undefined;
customSuccessMessage?: ((res: ServerResponse) => string) | undefined;
customErrorMessage?: ((error: Error, res: ServerResponse) => string) | undefined;
customAttributeKeys?: CustomAttributeKeys | undefined;
wrapSerializers?: boolean | undefined;
reqCustomProps?: ((req: IncomingMessage, res: ServerResponse) => object) | undefined;
quietReqLogger?: boolean | undefined;
}
interface GenReqId {
(req: IncomingMessage): ReqId;
}
interface AutoLoggingOptions {
ignore?: (req: IncomingMessage) => boolean;
ignorePaths?: Array<string | RegExp> | undefined;
getPath?: ((req: IncomingMessage) => string | undefined) | undefined;
}
interface CustomAttributeKeys {
req?: string | undefined;
res?: string | undefined;
err?: string | undefined;
reqId?: string | undefined;
responseTime?: string | undefined;
}
const startTime: unique symbol;
}
declare module "http" {
interface IncomingMessage {
id: PinoHttp.ReqId;
log: Logger;
}
interface ServerResponse {
err?: Error | undefined;
}
interface OutgoingMessage {
[PinoHttp.startTime]: number;
}
}
These definitions were written by Christian Rackerseder, Jeremy Forsythe, Griffin Yourick, and Jorge Barnaby.
FAQs
TypeScript definitions for pino-http
The npm package @types/pino-http receives a total of 60,828 weekly downloads. As such, @types/pino-http popularity was classified as popular.
We found that @types/pino-http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.