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

rollup-plugin-pino-bundle

v1.0.2

Published

Rollup plugin for bundling PinoJS logger with transports

Readme

Rollup/Vite Pino Plugin Documentation

Overview

This plugin provides seamless bundling of Pino logger and its transports for Rollup and Vite projects. It handles the special requirements of Pino's worker threads and file transports, making them work properly in bundled applications.

Installation

npm install -D rollup-plugin-pino-bundle

Usage

Basic Configuration (Rollup)

import { rollup } from 'rollup';
import pinoBundle from 'rollup-plugin-pino-bundle';

const bundle = await rollup({
    input: 'src/main.js',
    plugins: [
        pinoBundle({
            transports: ['pino-pretty'], // optional transports to include
            pinoDir: 'custom-pino', // optional custom directory
        }),
    ],
});

Basic Configuration (Vite)

import { defineConfig } from 'vite';
import pinoBundle from 'rollup-plugin-pino-bundle';

export default defineConfig({
    plugins: [
        pinoBundle({
            transports: ['pino-pretty'], // optional transports to include
            transportsDir: 'custom-transports', // optional custom transports directory
        }),
    ],
});

Options

transports

Type: string[]
Default: []

An array of pino transport module names to bundle with your application.

Example:

pinoBundle({
    transports: ['pino-pretty', 'pino-loki'],
});

pinoDir

Type: string
Default: 'pino'

Set custom directory for pino files. This is the root directory where all pino-related files will be placed.

Example:

pinoBundle({
    pinoDir: 'custom-pino',
});

transportsDir

Type: string
Default: ${pinoDir}/transports

Set custom directory for all transports. By default, it will be a subdirectory of the pinoDir.

Example:

pinoBundle({
    transportsDir: 'my-transports', // will be relative to output directory
});

File Structure

The plugin creates the following directory structure in your output folder:

/pino
  /pino.js                # Main pino bundle
  /transports
    /pino-file.js         # File transport worker
    /pino-worker.js       # Worker implementation
    /thread-stream-worker.js # Thread stream worker
    /[transport-name].js   # Any additional transports you specify

Caching

The plugin implements caching to improve build performance

TypeScript Support

The package includes TypeScript type definitions out of the box.

Limitations

  1. Currently has limited Vite dev server support (planned for future versions)

Troubleshooting

Problem: Transports not working in production build
Solution: Make sure to include all required transports in the transports option

Contributing

Contributions are welcome! Please open issues or pull requests on GitHub.

License

MIT