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

claude_stream_viewer

v1.0.16

Published

Claude Stream Viewer - Pretty-prints Claude API stream-json events from stdin with colorized output.

Readme

claude_stream_viewer

Pretty-prints Claude Code stream-json events from stdin with colorized output. Drop it at the end of a claude --output-format stream-json pipe to read the stream as a human instead of as raw JSON.

claude_stream_viewer demo

Requirements

Install

npm install -g claude_stream_viewer
# or run on demand without installing
npx claude_stream_viewer@latest

Usage

Pipe any source of stream-json events into the viewer:

claude --output-format stream-json --verbose \
       --permission-mode auto -p "explain quantum computing like I'm 5" \
  | npx claude_stream_viewer@latest

The viewer reads one JSON event per line from stdin and writes a colorized, human-readable rendering to stdout. It exits when stdin closes, printing [stream ended].

What it renders

The viewer consumes Claude Code's consolidated event layer (system, assistant, user, rate_limit_event, result). The fine-grained stream_event SSE envelopes are ignored — the consolidated events already carry fully assembled content blocks.

| Event | Output | |--------------------|-------------------------------------------------------------------------------------| | system (init) | === SESSION === header with model, cwd, tool count, session id, claude-code version | | assistant | One block per content type: --- thinking ---, plain assistant text, or → <tool> with a per-tool compact body (Bash → $ <command>, Read/Write/Edit → file path, Grep/Glob → pattern, TodoWrite → checkbox list, etc.). Unknown tools fall back to a JSON dump. | | user | ← <tool> result (or ← <tool> ERROR) followed by the tool output, truncated past 40 lines | | rate_limit_event | One-line [rate_limit] <status> notice | | result | === RESULT === summary with terminal_reason, turns, duration, cost, token totals | | stream_event | Silently skipped | | Anything else | === <type> === header followed by the raw JSON |

Tool calls and their results are paired by tool_use_id, so each ← <tool> result is labeled with the matching call's tool name.

Malformed lines are reported on stderr (Invalid JSON: …) without aborting the stream.

Options

| Flag | Description | Default | |--------------|--------------------------|---------| | --no-color | Disable colored output | colored | | --version | Print the package version | — | | --help | Print usage help | — |

Development

cd packages/claude_stream_viewer
npm install
npm run dev        # tsx ./src/claude_stream_viewer.ts
npm run build      # compile TypeScript → dist/
npm run typecheck  # type-check without emitting

Output

  • Rendered events are written to stdout.
  • Parse errors and processing errors are written to stderr; the process keeps reading.