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 🙏

© 2025 – Pkg Stats / Ryan Hefner

winston-transport-debug-console

v1.0.3

Published

A Winston transport that makes logs visible in inspector clients (like VS Code’s Debug Console) with support for fully inspectable objects.

Downloads

32

Readme


Why?

By default, Winston writes to stdout/stderr. When debugging in a Node inspector client (like VS Code's Debug Console) those logs either won't make it to the debug console, or you must use some other method to capture them (like "outputCapture": "std" in VS Code), even then, they'll appear as plain strings in the Debug Console — You will not get object inspection.

This transport uses Node’s inspector.console API (based on the Chrome DevTools Protocol) to send logs directly to the inspector. The result:

  • Logs show up in VS Code’s Debug Console (and Chrome DevTools, WebStorm, etc.)
  • Objects remain inspectable, not stringified
  • No duplication in the terminal — inspector.console does not touch stdout/stderr

Install

npm install winston-transport-debug-console

Usage

import { createLogger, format, transports } from "winston"
import { DebugConsole } from "winston-transport-debug-console"

const logger = createLogger({
    level: "debug",
    format: format.combine(format.timestamp(), format.errors({ stack: true }), format.splat()),
    transports: [
        // Show inspectable objects in VS Code Debug Console
        new DebugConsole(),

        // Keep pretty logs in the terminal too
        new transports.Console({
            format: format.combine(
                format.colorize(),
                format.timestamp(),
                format.printf(({ level, message, timestamp, ...meta }) => {
                    const extra = Object.keys(meta).length ? ` ${JSON.stringify(meta, null, 2)}` : ""
                    return `${timestamp} ${level}: ${message}${extra}`
                })
            ),
        }),
    ],
})

logger.info("User loaded", { id: 42, name: "Alice" })

In VS Code Debug Console, the id and name object are fully expandable. In your terminal, you still see pretty, colored log lines.

Logs show as originating from debug-console-transport.js:35?

If you see logs originating from debug-console-transport.js:35 and you're using VS Code, you may need to set the following in your launch.json:

"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"]

Options

new DebugConsole({
    level: "debug", // Winston's level filter (default: "info")
    levelMap: {
        // Optional map for custom levels
        crit: "error", // Map your "crit" level to inspector.console.error
        silly: "debug",
    },
})
  • levelMap: Map unsupported Winston levels to existing inspector console methods. Throws if you try to use a level that isn’t supported and isn’t mapped.

Node.js Compatibility

Requires Node.js ≥ 11.0.0 (when inspector.console was introduced). Tested on Node 18 and 20.


License?

MIT