npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@edirect/logger

v11.0.50

Published

Structured logging module for eDirect NestJS applications. Built on top of [Pino](https://github.com/pinojs/pino), providing high-performance JSON logging to stdout/stderr, configurable log levels, and correlation ID tracking (sessionId / quoteId).

Readme

@edirect/logger

Structured logging module for eDirect NestJS applications. Built on top of Pino, providing high-performance JSON logging to stdout/stderr, configurable log levels, and correlation ID tracking (sessionId / quoteId).

Features

  • Structured JSON logs with consistent field names (message, level, timestamp, name, version)
  • Outputs to stdout/stderr
  • Configurable log level via environment variable or module options
  • Tracks sessionId and quoteId as correlation context in all log entries
  • Global module — register once, inject LoggerService anywhere
  • Supports both sync (register) and async (registerAsync) configuration

Installation

pnpm add @edirect/logger
# or
npm install @edirect/logger

Usage

Simple registration (static options)

import { Module } from '@nestjs/common';
import { LoggerModule } from '@edirect/logger';

@Module({
  imports: [
    LoggerModule.register({
      output: 'console',
      level: 'info',
      name: 'my-service',
    }),
  ],
})
export class AppModule {}

Async registration (with ConfigService)

import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@edirect/config';
import { LoggerModule } from '@edirect/logger';

@Module({
  imports: [
    ConfigModule,
    LoggerModule.registerAsync({
      imports: [ConfigModule],
      useFactory: (configService: ConfigService) => ({
        level: (configService.get('LOGS_LEVEL') as any) ?? 'info',
        name: configService.get('APP_NAME') ?? 'app',
      }),
      inject: [ConfigService],
    }),
  ],
})
export class AppModule {}

Inject and use LoggerService

import { Injectable } from '@nestjs/common';
import { LoggerService } from '@edirect/logger';

@Injectable()
export class OrderService {
  constructor(private readonly logger: LoggerService) {}

  async processOrder(orderId: string, sessionId: string) {
    this.logger.setSessionId(sessionId);
    this.logger.setQuoteId(orderId);

    this.logger.info('Processing order', JSON.stringify({ orderId }));
    try {
      // business logic...
      this.logger.log('Order processed successfully');
    } catch (err) {
      this.logger.error('Order processing failed', (err as Error).stack ?? '');
    }
  }
}

API

LoggerService methods

| Method | Signature | Description | | -------------- | ------------------------------------------- | ----------------------------------------------------------- | | log | (message: string, payload?: string): void | Alias for info | | info | (message: string, payload?: string): void | Log at INFO level | | warn | (message: string, payload?: string): void | Log at WARN level | | error | (message: string, trace: string): void | Log at ERROR level | | debug | (message: string): void | Log at DEBUG level | | verbose | (message: string): void | Log at VERBOSE level (maps to INFO internally) | | setSessionId | (sessionId: string): void | Attach a session ID to all subsequent log entries | | setQuoteId | (quoteId: string): void | Attach a quote/correlation ID to all subsequent log entries |

LoggerModuleOptions

| Option | Type | Default | Description | | ---------- | ------------ | -------------------------------- | ---------------------------------- | | level | pino.Level | 'info' | Minimum log level | | name | string | npm_package_name \| 'app' | Service name in every log entry | | version | string | npm_package_version \| '0.0.0' | Service version in every log entry | | host | string | '0.0.0.0' | Host tag | | protocol | string | 'http' | Protocol tag |

Environment Variables

When options are not passed explicitly, the logger reads from environment variables:

| Variable | Description | Default | | --------------- | -------------------------------------------------------------- | -------------------------------- | | LOGS_LEVEL | Log level (trace, debug, info, warn, error, fatal) | info | | LOGS_HOST | Host tag in log entries | 0.0.0.0 | | LOGS_PROTOCOL | Protocol tag in log entries | http | | APP_NAME | Service name | npm_package_name or app | | APP_VERSION | Service version | npm_package_version or 0.0.0 |

Log Output Format

Every log entry is a JSON object:

{
  "level": "info",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "name": "payment-gateway",
  "version": "1.2.3",
  "host": "pod-abc-123",
  "protocol": "http",
  "sessionId": "session-abc-123",
  "quoteId": "quote-xyz-456",
  "remote-address": "",
  "message": "Order created successfully",
  "payload": { "orderId": "ORD-789" }
}