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

pw-trace-normalizer

v0.1.0

Published

Transform Playwright trace ZIPs into AI-friendly normalized output for fast failure diagnosis

Readme

pw-trace-normalizer

Transform Playwright trace ZIPs into AI-friendly normalized output for fast failure diagnosis.

Raw Playwright traces are large, SHA1-hashed blobs of NDJSON that are hard for AI to navigate. pw-trace-normalizer converts them into a structured directory with human-readable files — cutting AI analysis time by compared to raw traces.

Install

npm install -g pw-trace-normalizer
# or use directly with npx (no install needed)
npx pw-trace-normalizer <trace.zip>

Usage

# Transform a trace ZIP
pw-trace-normalizer trace.zip

# Custom output directory
pw-trace-normalizer trace.zip --output ./my-output

# Include sensitive headers (Cookie, Authorization)
pw-trace-normalizer trace.zip --include-secrets

# Don't overwrite existing output
pw-trace-normalizer trace.zip --no-overwrite

Output structure

<output-dir>/
├── summary.json          # Primary error, failure type, user flow, root cause hints
├── failure-timeline.json # ±30s of events around each error, correlated network calls
├── steps-outline.json    # All test steps condensed by phase (hooks / test-body)
├── index.json            # Full step tree with all metadata
├── console.jsonl         # All console messages (log / warn / error)
├── dom/                  # HTML snapshots per step (pw_api_42.html, ...)
├── network/
│   ├── index.json        # All network calls with sequential IDs (req-0001, ...)
│   ├── failures.json     # 4xx / 5xx calls only
│   └── req-NNNN.json     # Full request + response per call
├── screenshots/          # Renamed screenshots (stepId-before-001.jpeg, ...)
├── logs/                 # Raw call logs per step
└── stacks/               # Stack frames per network call

AI analysis

The output is designed for Claude Code (or any AI) to diagnose failures fast. Point it at the output directory:

"Read summary.json, then failure-timeline.json, and diagnose the root cause of this test failure."

Typical diagnosis time: ~2.5 min / 25–35 tool calls vs ~7.5 min / 45–56 tool calls for raw traces.

Library API

import { transformTrace, compareTraces } from 'pw-trace-normalizer';

// Transform a single trace
const { outputDir, warnings } = await transformTrace('./trace.zip', './output', {
  noOverwrite: false,
  includeSecrets: false,
});

// Compare a passing trace vs a failing trace
await compareTraces('./passing.zip', './failing.zip', './diff-output');

How it works

  1. Extracts the trace ZIP to a temp directory
  2. Streams all .trace NDJSON files to build a step tree
  3. Streams .network NDJSON to extract and index network calls
  4. Parses .stacks for stack frame enrichment
  5. Converts DOM blob snapshots into readable HTML
  6. Renames SHA1 screenshots to human-readable filenames
  7. Pre-computes summary.json, failure-timeline.json, and steps-outline.json so AI starts with the answer, not the raw data

License

MIT