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 🙏

© 2024 – Pkg Stats / Ryan Hefner

pino-devtools

v2.8.0

Published

A transport for viewing the logs in your favorite browser devtools

Downloads

712

Readme

pino-devtools

GitHub Actions

A transport for viewing logs in your favorite browser devtools!

Installation

$ npm i pino-devtools

Usage

Given an application your-app.js that logs via pino, you would use pino-devtools like so:

$ node your-app.js | pino-devtools

pino-devtools automatically opens a page in your default browser (unless --no-open is supplied). Open the devtools and you will see the logs coming from your application into the console tab.

Options

  • --host 127.0.0.1: the host for the HTTP and web socket servers
  • --port 3010: the HTTP server port
  • --no-open: do not automatically open the page in the browser
  • --mode websocket: the server mode, more information in the next section
  • --tee: also send the logs to stdout

Note: the web socket port is port + 1.

Server modes

The server can be started in one of these two modes:

  • websocket: the default mode, which opens a new tab in your browser and forwards the logs via a websocket. There is nothing to configure in your application
  • buffer: a mode that does not open a new tab or use a websocket but uses a buffer to store all the logs and a client in your application to output those logs in the same console as your application

buffer mode

Use pino-devtools like so:

$ node your-app.js | pino-devtools --mode buffer

Update your application code to require the pino-devtools client and calls the fetchBufferedLogs() async function as early as possible:

// index.js
const { fetchBufferedLogs } = require('pino-devtools/src/client');

await fetchBufferedLogs();

License

pino-devtools is released under the Mozilla Public License Version 2.0. See the bundled LICENSE file for details.