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

nest-devtools

v0.1.6

Published

A zero-config developer dashboard for NestJS applications.

Readme

nest-devtools

A zero-config developer dashboard for NestJS applications.

nest-devtools mounts a browser UI inside your Nest app so you can watch logs and HTTP requests in real time while developing.

Features

  • Zero-config module setup with DevtoolsModule.forRoot()
  • Live logs captured from Nest Logger and ConsoleLogger
  • Live HTTP request tracing with method, path, status, duration, and redacted headers
  • Newest logs and requests shown first in the dashboard
  • In-memory circular-style buffers for logs and requests
  • Embedded dashboard UI served by your Nest app
  • Raw WebSocket live updates, no frontend framework required
  • Auto-disabled when NODE_ENV === 'production'

Compatibility

  • NestJS ^10.0.0 || ^11.0.0
  • reflect-metadata ^0.1.12 || ^0.2.0
  • rxjs ^7.8.0

Install

npm i nest-devtools

If you are testing the package locally before publishing a new version, install it from the repo instead of npm:

npm i /absolute/path/to/nest-devtool

Or pack it first and install the generated tarball:

npm pack
npm i ./nest-devtools-0.1.3.tgz

Quick Start

Import the module in your app module:

import { Module } from '@nestjs/common';
import { DevtoolsModule } from 'nest-devtools';

@Module({
  imports: [DevtoolsModule.forRoot()],
})
export class AppModule {}

Start your app and open:

http://localhost:3000/__devtools__

That is enough for the dashboard to start collecting:

  • Nest logs
  • request traces
  • request and response payload snapshots
  • live updates through the built-in WebSocket endpoint

How It Works

At runtime, nest-devtools follows this flow:

  1. DevtoolsModule.forRoot() is imported into your Nest app.
  2. If NODE_ENV === 'production', the module becomes a no-op and does nothing.
  3. In development, the module registers:
    • an in-memory store for logs and requests
    • a dashboard controller
    • a realtime WebSocket server
    • a logger capture provider
    • a global request interceptor
  4. The logger capture provider patches Nest's built-in Logger and ConsoleLogger paths so log calls are normalized, stored in memory, and pushed to connected dashboard clients.
  5. The request interceptor captures request details when a request enters Nest:
    • method
    • path
    • headers
    • request body
    • uploaded file metadata when files are present
  6. The interceptor also captures the outgoing response when it is written back to the client:
    • final status code
    • duration
    • response body
  7. The dashboard page loads initial snapshots from the REST API:
    • GET /__devtools__/api/logs
    • GET /__devtools__/api/requests
  8. After that, the browser opens the built-in WebSocket endpoint and receives live updates:
    • log
    • request
    • clear:logs
    • clear:requests

Body Capture Rules

  • JSON, text, arrays, objects, numbers, booleans, and null values are stored when they fit within the limit.
  • Request and response bodies are limited to 4kB.
  • If a body is larger than 4kB, the dashboard stores a note indicating that the payload was too large instead of storing the full content.
  • Binary payloads are not stored directly.
  • For uploaded files and binary responses, the dashboard stores metadata only.

Configuration

import { Module } from '@nestjs/common';
import { DevtoolsModule } from 'nest-devtools';

@Module({
  imports: [
    DevtoolsModule.forRoot({
      maxLogs: 500,
      maxRequests: 500,
      path: '__devtools__',
      capture: {
        logs: {
          excludeLevels: ['debug'],
        },
        requests: {
          excludeMethods: ['OPTIONS'],
        },
      },
    }),
  ],
})
export class AppModule {}

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | maxLogs | number | 500 | Maximum number of log entries kept in memory | | maxRequests | number | 500 | Maximum number of request entries kept in memory | | path | string | __devtools__ | Base path used for the dashboard and API routes | | capture | DevtoolsCaptureOptions | { logs: { enabled: true }, requests: { enabled: true } } | Global capture filters for logs and requests |

Examples:

  • path: '__devtools__' -> /__devtools__
  • path: '/inspect/' -> /inspect
  • path: 'internal/devtools' -> /internal/devtools

Capture Filters

import { Module } from '@nestjs/common';
import { DevtoolsModule } from 'nest-devtools';

@Module({
  imports: [
    DevtoolsModule.forRoot({
      capture: {
        logs: {
          excludeLevels: ['debug', 'verbose'],
        },
        requests: {
          excludeMethods: ['OPTIONS', 'HEAD'],
        },
      },
    }),
  ],
})
export class AppModule {}
  • capture.logs.enabled: disable log capture entirely
  • capture.logs.excludeLevels: skip selected Nest log levels such as log, warn, error, debug, and verbose
  • capture.requests.enabled: disable request capture entirely
  • capture.requests.excludeMethods: skip selected HTTP methods such as OPTIONS

Ignore Decorator

Use @IgnoreDevtools() on a controller class or route handler when you do not want devtools to collect from that scope.

import { Controller, Get, Logger } from '@nestjs/common';
import { IgnoreDevtools } from 'nest-devtools';

@Controller('health')
@IgnoreDevtools({ requests: true })
export class HealthController {
  private readonly logger = new Logger(HealthController.name);

  @Get()
  check() {
    this.logger.log('health check hit');
    return { ok: true };
  }

  @Get('silent')
  @IgnoreDevtools()
  silent() {
    this.logger.log('this log will not be collected');
    return { ok: true };
  }
}
  • @IgnoreDevtools(): ignore both logs and requests for that controller or handler
  • @IgnoreDevtools({ logs: true }): ignore only logs
  • @IgnoreDevtools({ requests: true }): ignore only requests

How To Use It

Once your Nest app is running:

  1. Open the dashboard URL in your browser.
  2. Hit your normal API routes from Postman, your frontend, curl, or the browser.
  3. Watch logs and requests appear live in the dashboard.

Logs Tab

  • Shows log, warn, error, debug, and verbose
  • Shows the newest log entry first
  • Includes timestamp, level, context, and message
  • Supports client-side search and level filters
  • Can be cleared from the UI

Requests Tab

  • Shows timestamp, method, path, status, and duration
  • Shows the newest request first
  • Streams requests live as they finish
  • Lets you filter by HTTP method and status range
  • Expands each row to show the full path, headers, request body, and response body
  • Long paths are truncated in the table so they do not break the layout

What Gets Captured

Logs

The package captures logs that go through Nest's built-in logging path:

  • Logger.log()
  • Logger.warn()
  • Logger.error()
  • Logger.debug()
  • Logger.verbose()
  • direct ConsoleLogger usage

Requests

The package captures HTTP requests handled by Nest and stores:

  • method
  • path
  • status code
  • duration in milliseconds
  • timestamp
  • optional request headers
  • request body snapshot
  • response body snapshot
  • uploaded file metadata when present

Request and response body behavior:

  • bodies up to 4kB are stored
  • bodies larger than 4kB are replaced with a "payload too large" note
  • binary content is omitted from storage
  • file uploads and binary responses keep metadata only

Sensitive headers are redacted:

  • authorization
  • cookie
  • set-cookie
  • proxy-authorization
  • x-api-key

Routes

With the default path, the module exposes:

| Method | Path | Description | | --- | --- | --- | | GET | /__devtools__ | Dashboard UI | | GET | /__devtools__/api/logs | Current log buffer | | GET | /__devtools__/api/requests | Current request buffer | | DELETE | /__devtools__/api/logs | Clear logs | | DELETE | /__devtools__/api/requests | Clear requests | | WS | /__devtools__/ws | Live realtime stream |

Production Behavior

If NODE_ENV === 'production', DevtoolsModule.forRoot() becomes a no-op:

  • no dashboard route
  • no API endpoints
  • no request interceptor
  • no logger patching
  • no WebSocket listener

Notes

  • Everything is in memory only.
  • The dashboard does not persist data across restarts.
  • The dashboard skips recording its own requests to avoid self-noise.
  • This package is intended for development, not production monitoring.

Example App In This Repo

Run the included example app:

npm install
npm run example:start

Then open:

http://localhost:3000/__devtools__

Useful example routes:

  • GET /
  • GET /users/123
  • GET /warn
  • GET /fail

Development

npm install
npm run build
npm test