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

fishtail

v0.2.5

Published

Interactive Mermaid diagram viewer — renders a self-contained HTML page with transitive node highlighting.

Readme

fishtail

Interactive Mermaid diagram viewer. Give it a .mermaid file and fishtail spins up a local dev server, opens your browser, and live-reloads whenever you save the file.

Click a node to highlight its full upstream and downstream transitive closure. Use focus mode to hide everything else.

Install

npm

npm install -g fishtail

Bun

bun add -g fishtail

Run without installing

npx fishtail diagram.mermaid
bunx fishtail diagram.mermaid

Usage

fishtail [file] [options]

Arguments

| Argument | Description | |----------|-------------| | file | Path to a .mermaid file. Omit to read from stdin. |

Options

| Option | Description | |--------|-------------| | --save | Write HTML to a file instead of opening the browser. | | -o, --output <file> | Output path for --save (default: <file>.html). | | -p, --port <number> | Dev server port (default: 5000). | | --no-open | Do not open the browser automatically. |

Behaviour matrix

| Invocation | Behaviour | |------------|-----------| | fishtail ./diagram.mermaid | Start dev server, open browser, watch for changes | | fishtail ./diagram.mermaid --save | Write ./diagram.html and exit | | fishtail ./diagram.mermaid -o out.html | Write out.html and exit | | fishtail (stdin) | Read stdin, print HTML to stdout |

Examples

# Open in browser with live reload
fishtail deps.mermaid

# Save to file
fishtail deps.mermaid --save
fishtail deps.mermaid -o deps.html

# Pipe from another tool
polydep graph --root . | fishtail > deps.html

# Use a different port
fishtail deps.mermaid -p 8080

Live reload

When running in dev server mode, fishtail watches the source file for changes. The browser reloads automatically whenever you save — no manual refresh needed. Parse errors are displayed as a styled error page in the browser; when the file is fixed the browser reloads to the working diagram.

Supported diagram types

Only graph and flowchart diagrams are supported. Passing any other Mermaid diagram type (e.g. sequenceDiagram, classDiagram, gantt) will print an error and exit with code 1.

graph LR
  subgraph bases
    api
  end
  subgraph components
    service
    log
    db
  end
  api --> service
  service --> log
  log --> db

What the viewer does

The generated HTML page is fully self-contained — all JavaScript is embedded inline.

Sidebar lists every node alphabetically with a colour dot indicating its subgraph. A search box filters the list in real time and pans the graph to matching nodes.

Click a node to highlight its transitive closure — all ancestors and descendants recursively — and dim everything else. The node appears selected in the sidebar.

Focus selected hides all nodes outside the transitive closure so you can focus on a single neighbourhood without the clutter of the rest of the graph.

Fit all / Reset restore the full graph.

Tooltip on hover shows the node name, its subgraph, and its in/out-degree.

Development

git clone https://github.com/aulme/fishtail
cd fishtail
bun install
bunx playwright install chromium
bun run build:viewer   # required once after install, and after editing src/viewer/index.ts
bun run build          # build viewer bundle + CLI
bun run test:unit      # unit tests (bun:test)
bun run test:browser   # browser tests (Playwright)
bun run lint           # TypeScript type check

License

MIT