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

@supawatch/target-erd

v0.14.2

Published

A Mermaid ER diagram generated from live Postgres by supawatch, kept current on every schema change.

Readme

@supawatch/target-erd

The ER-diagram target for supawatch. Emits schema.erd.md: a Mermaid erDiagram inside a fenced block that GitHub renders natively, with PK and FK markers and relationship edges built from real foreign keys. Regenerated on every schema change, so the diagram stays correct instead of correct-once.

Configure it in supawatch.config.ts (the CLI loads this package by name):

targets: [{ kind: "erd" }]
// or, explicitly:
targets: [{ kind: "erd", attributes: "keys", maxTextSize: 50000 }]

A nullable foreign key renders as an optional relationship. Views appear as entities alongside tables. Database identifiers are free-form while Mermaid accepts only word-safe tokens, so entities carry a safe identifier plus the real name as a quoted display alias, and sanitized column names keep the original in the attribute comment.

Large schemas

Two Mermaid behaviors make big schemas render badly, and this target works around both by default, stating in a note whenever it trimmed something.

Mermaid refuses to render a diagram whose source passes maxTextSize (its own default is 50000 characters) and shows "Maximum text size in diagram exceeded" instead. So the target emits every column when that fits, otherwise key columns only, otherwise relationships only. Set attributes ("all" | "keys" | "none") to choose explicitly, and maxTextSize to match a renderer configured with a larger limit.

Mermaid also lays entities that have no relationships out in a single endless row, which stretches the canvas into an unreadable strip. Past maxIsolated (default 10) those tables are omitted and counted, and past maxEntities (default 60) the least connected go too. Every relationship between the entities that remain is always drawn. Set either to 0 to disable that cap.

MIT.