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

inspect-json-cli

v0.1.2

Published

Zero-dependency CLI for filtered pretty-printing of JSON-heavy AI logs (LLM requests, responses, JSONL).

Readme

inspect-json-cli

CI npm version node

inspect-json is a zero-dependency Node.js CLI for filtered pretty-printing of JSON-heavy AI logs.

It is meant for files like:

  • LLM request payloads (e.g. OpenAI / OpenRouter chat completions)
  • LLM response payloads
  • raw request/response artifacts captured from AI tooling
  • JSONL logs
  • generic JSON files
  • JSON in JSON strings

It is not an interactive viewer. It is a terminal renderer that detects common shapes, recursively decodes JSON embedded inside JSON strings, and prints the useful parts first.

Install

npm i -g inspect-json-cli

At a glance

Given a real LLM response whose message.content is a JSON string, inspect-json detects the response shape, decodes the embedded JSON, and shows the useful parts:

$ inspect-json examples/structured-output-response.json
LLM Response
model: nvidia/nemotron-3-nano-omni
system_fingerprint: nvidia/nemotron-3-nano-omni
usage: 195 total / 58 prompt / 137 completion / 101 reasoning

choice[0]
finish: stop
  role: assistant
  content: json object
    {
      "name": "Ada Lovelace",
      "born": 1815,
      "occupation": "mathematician"
    }

More worked examples (basic chat, tool calls) live in examples/.

Requirements

  • Node.js 22 or newer (uses built-ins only).

Install Locally

npm run install-local

By default this writes an inspect-json shim to ~/.local/bin.

You can choose a different destination or command name:

npm run install-local -- --dir ./bin --name inspect-json-dev

Global npm install also works:

npm install -g .

Or run directly:

node bin/inspect-json.mjs raw-response.json

Examples

Let the tool auto-detect the strategy:

inspect-json raw-response.json

Force a request lens:

inspect-json --strategy llm_request raw-request.json

Force a response lens:

inspect-json --strategy llm_response raw-response.json

Use stdin:

cat raw-response.json | inspect-json

Include lower-level ids, raw payloads, and extra metadata:

inspect-json --verbose raw-response.json

Disable color:

inspect-json --no-color raw-response.json

Disable JSON-in-JSON decoding:

inspect-json --raw raw-response.json

Options

--strategy <name>  Force a strategy: json, llm_request, llm_response
-v, --verbose      Include lower-level ids, raw payloads, and extra metadata
--raw              Disable JSON-in-JSON decoding and strategy transforms
--color            Force ANSI color
--no-color         Disable ANSI color
-h, --help         Show help

Color is on by default for TTY output. It is disabled automatically when output is not a TTY or when the NO_COLOR environment variable is set.

Concepts

The renderer is intentionally structured around named strategies and transformers.

Strategies decide how to display a document:

  • json: generic pretty JSON fallback
  • llm_request: model, messages, tools, response format
  • llm_response: choices, assistant content, tool calls, usage, errors

Transformers prepare data before rendering:

  • json_in_json: recursively parses string values that contain valid JSON

The --raw flag skips transformers entirely, leaving values exactly as parsed.

When no strategy is supplied, inspect-json scores the input and chooses the most specific strategy. You can override that with --strategy.

Output Style

The output is a filtered pretty print, not a graph. It tries to answer:

  • What model/provider was used?
  • What messages were sent?
  • What tools were exposed?
  • What tool calls came back?
  • What did message.content contain?
  • Was embedded JSON returned as a string?
  • What token/cost/usage fields were present?

Development

npm test        # run the node:test suite
npm run check   # syntax check + biome lint
npm run format  # apply biome formatting

This project depends only on Node.js built-ins and has no runtime or dev dependencies. Biome is used for formatting and linting and is expected to be available on your PATH (e.g. installed globally).

License

MIT