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

@sbtools/plugin-logs

v0.9.0

Published

Docker log tailing, pg_stat_statements, and log viewer plugin for supabase-tools.

Readme

@sbtools/plugin-logs

Plugin for supabase-tools that adds live Docker log tailing, pg_stat_statements query performance monitoring, and a browser log viewer rendered via shared @sbtools/ui-web.

Quick Start

# 1. Add to supabase-tools.config.json → plugins array:
#    { "path": "@sbtools/plugin-logs", "config": {} }

# 2. Tail all services
npx tsx supabase-tools/cli.ts logs

# 3. Open the live log viewer
npx tsx supabase-tools/cli.ts logs viewer
#    → http://localhost:3333

Commands

| Command | Description | |---|---| | logs | Tail all running services (multiplexed, coloured) | | logs <service> | Tail a single service (e.g. logs functions, logs db) | | logs --list | List services with running/stopped status | | logs pg-stats | Top 20 queries by total execution time | | logs pg-stats --slow | Top 20 by mean execution time | | logs pg-stats --frequent | Top 20 by call count | | logs pg-stats --reset | Reset pg_stat_statements data | | logs pg-stats --json | Output raw JSON | | logs viewer | Start live HTML log viewer (default port 3333) | | logs viewer --port N | Custom viewer port | | logs --help | Show full help |

All commands: npx tsx supabase-tools/cli.ts logs <subcommand>

Available services: functions, db, rest, auth, kong, storage, realtime, studio, meta, inbucket.

Log Viewer

The viewer at http://localhost:3333 provides:

  • Real-time log streaming via Server-Sent Events
  • Service filter chips (toggle individual services on/off)
  • Log level filters (ERROR, WARN, INFO, DEBUG)
  • Full-text search across log messages
  • Auto-scroll with pause/resume
  • Query Performance tab with sortable pg_stat_statements data
  • Service Health tab showing container status

Configuration

Add to supabase-tools.config.json:

{
  "plugins": [
    {
      "path": "@sbtools/plugin-logs",
      "config": {
        "viewerPort": 3333,
        "tailLines": 100,
        "dbContainer": "supabase-db"
      }
    }
  ]
}

All config fields are optional and have sensible defaults.

Dependencies

| Type | Requirement | |------|-------------| | Docker | Must be running; containers discovered via deriveContainerPrefix | | Config | project.name in supabase-tools.config.json (or basename fallback) |

Requirements

  • Docker (services must be running for log tailing)
  • Node.js 18+
  • tsx (installed as devDependency in the parent project)
  • No additional npm dependencies

Project Structure

plugin-logs/
├── index.ts          # Plugin entry point
├── src/
│   ├── index.ts      # Plugin implementation
│   ├── docker-logs.ts # Container discovery and log tailing
│   ├── formatter.ts  # Log parsing and ANSI colourisation
│   ├── pg-stats.ts   # pg_stat_statements via docker exec psql
│   ├── viewer.ts     # HTTP + SSE server
│   ├── viewer-html.ts # Delegates page rendering to @sbtools/ui-web
│   └── atlas/
│       └── styles.ts # Additional CSS for atlas sections
├── package.json
├── SKILL.md
└── README.md